Skip to content

Instantly share code, notes, and snippets.

@barseghyanartur
Created June 10, 2014 07:03
Show Gist options
  • Save barseghyanartur/44d7b0f659a4798b2807 to your computer and use it in GitHub Desktop.
Save barseghyanartur/44d7b0f659a4798b2807 to your computer and use it in GitHub Desktop.
Index: django/contrib/admin/templates/admin/change_list.html
===================================================================
--- django/contrib/admin/templates/admin/change_list.html (revisión: 16133)
+++ django/contrib/admin/templates/admin/change_list.html (copia de trabajo)
@@ -27,6 +27,18 @@
(function($) {
$(document).ready(function($) {
$("tr input.action-select").actions();
+
+ $('#display-filter').click(function(event) {
+ $('#changelist').addClass('filtered');
+ $('#changelist-filter').show('slow');
+ $('#display-filter').hide('slow');
+ });
+ $('#change-title').click(function(event) {
+ $('#changelist').removeClass('filtered');
+ $('#changelist-filter').hide('slow');
+ $('#display-filter').show('slow');
+ });
+
});
})(django.jQuery);
</script>
@@ -80,8 +92,12 @@
{% block filters %}
{% if cl.has_filters %}
+ <h2 id="display-filter" style="display:none">
+ {% trans 'Filter' %}:
+ {% for spec in cl.filter_specs %} {{ spec.title }}{{ spec.choices }}{% endfor %}
+ </h2>
<div id="changelist-filter">
- <h2>{% trans 'Filter' %}</h2>
+ <h2 id="change-title">{% trans 'Filter' %}</h2>
{% for spec in cl.filter_specs %}{% admin_list_filter cl spec %}{% endfor %}
</div>
{% endif %}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment