Skip to content

Commit

Permalink
Fixes #190 Django 1.6 compatiblity issue: Search fails in popups
Browse files Browse the repository at this point in the history
  • Loading branch information
darklow committed Feb 14, 2014
1 parent 824ed58 commit 306e036
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
7 changes: 4 additions & 3 deletions suit/templates/admin/change_list.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{% extends "admin/base_site.html" %}
{% load i18n admin_static admin_list admin_urls suit_list %}
{% load i18n admin_static admin_list admin_urls suit_list suit_tags %}
{% load url from future %}

{% block extrastyle %}
Expand Down Expand Up @@ -104,14 +104,15 @@
{% if action_form and actions_on_bottom and cl.full_result_count %}
{% admin_actions %}{% endif %}
{% else %}
{% suit_bc_value 1.5 'pop' 1.6 '_popup' as POPUP_VAR %}
<div class="alert alert-block alert-info">
{% if cl.full_result_count %}
<h4>{% trans 'Nothing found' %}!</h4>
<br>
<a href="?{% if cl.is_popup %}pop=1{% endif %}">{% trans 'Reset search and filters' %}</a>
<a href="?{% if cl.is_popup %}{{ POPUP_VAR }}=1{% endif %}">{% trans 'Reset search and filters' %}</a>
{% else %}
{% blocktrans with cl.opts.verbose_name_plural|capfirst as name_plural %}{{ name_plural }} are not created yet{% endblocktrans %}.
{% if has_add_permission %}<a href="{% url cl.opts|admin_urlname:'add' %}{% if is_popup %}?_popup=1{% endif %}">
{% if has_add_permission %}<a href="{% url cl.opts|admin_urlname:'add' %}{% if is_popup %}?{{ POPUP_VAR }}=1{% endif %}">
{% blocktrans with cl.opts.verbose_name as name %}Add {{ name }}{% endblocktrans %}</a>{% endif %}
{% endif %}
</div>
Expand Down
7 changes: 4 additions & 3 deletions suit/templates/admin/search_form.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{% load i18n admin_static suit_list admin_list %}
{% load i18n admin_static suit_list admin_list suit_tags %}
{% if cl.search_fields or cl.has_filters %}
{% suit_bc_value 1.5 'pop' 1.6 '_popup' as POPUP_VAR %}
<div id="toolbar" class="clearfix">
<form id="changelist-search" action="" method="get" class="form-inline">
<div class="search-container">
Expand All @@ -26,13 +27,13 @@
&nbsp;
{% if show_result_count %}
<span class="small quiet result-count">{% blocktrans count counter=cl.result_count %}{{ counter }} result{% plural %}{{ counter }} results{% endblocktrans %}
&nbsp; <a href="?{% if cl.is_popup %}pop=1{% endif %}">
&nbsp; <a href="?{% if cl.is_popup %}{{ POPUP_VAR }}=1{% endif %}">
{% blocktrans with full_result_count=cl.full_result_count %}{{ full_result_count }} total{% endblocktrans %}</a></span>
{% endif %}
</div>

{% if cl.is_popup %}
<input type="hidden" name="pop" value="1">
<input type="hidden" name="{{ POPUP_VAR }}" value="1">
{% endif %}

</form>
Expand Down

0 comments on commit 306e036

Please sign in to comment.