-
Notifications
You must be signed in to change notification settings - Fork 772
Commit
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,3 +10,4 @@ Contents: | |
config_file | ||
autocomplete | ||
compact_inline | ||
filters |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
======= | ||
Filters | ||
======= | ||
|
||
RelatedFieldAjaxListFilter | ||
-------------------------- | ||
|
||
See :doc:`autocomplete` documentation for details. | ||
|
||
django-admin-rangefilter | ||
------------------------ | ||
|
||
In order to fix compatibility issues with ``django-admin-rangefilter`` package you should use JET's admin filter class | ||
``jet.filters.DateRangeFilter`` instead of ``rangefilter.filter.DateRangeFilter``. | ||
|
||
.. code:: python | ||
#from rangefilter.filter import DateRangeFilter | ||
from jet.filters import DateRangeFilter | ||
class MyUserAdmin(UserAdmin): | ||
... | ||
list_filter = ( | ||
('date_joined', DateRangeFilter), | ||
) |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
VERSION = '1.0.2' | ||
VERSION = '1.0.3' |
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
.admindatefilter fieldset.module { | ||
padding: 10px; | ||
} | ||
|
||
.admindatefilter .form-row { | ||
padding: 10px; | ||
} | ||
|
||
.admindatefilter .controls { | ||
padding: 0 20px 20px 20px; | ||
} | ||
|
||
.admindatefilter .controls input[type="submit"] { | ||
margin-bottom: 0 !important; | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
{% load i18n admin_static %} | ||
<h3>{% blocktrans with filter_title=title %} By {{ filter_title }} {% endblocktrans %}</h3> | ||
<script> | ||
function datefilter_apply(event, qs_name, form_name){ | ||
event.preventDefault(); | ||
var query_string = django.jQuery('input#'+qs_name).val(); | ||
var form_data = django.jQuery('#'+form_name).serialize(); | ||
window.location = window.location.pathname + query_string + '&' + form_data; | ||
} | ||
function datefilter_reset(qs_name){ | ||
var query_string = django.jQuery('input#'+qs_name).val(); | ||
window.location = window.location.pathname + query_string; | ||
} | ||
</script> | ||
<div class="changelist-filter-popup admindatefilter"> | ||
<input class="changelist-filter-popup-toggle" type="text" value="{% blocktrans with filter_title=title %} By {{ filter_title }} {% endblocktrans %}" readonly> | ||
<div class="changelist-filter-popup-content"> | ||
<form method="GET" action="." id="{{ choices.0.system_name }}-form"> | ||
{{ spec.form.media }} | ||
<fieldset class="module aligned"> | ||
{% for field in spec.form %} | ||
<div class="form-row {{ field.id }}"> | ||
<div> | ||
{{ field }} | ||
</div> | ||
</div> | ||
{% endfor %} | ||
</fieldset> | ||
{% for choice in choices %} | ||
<input type="hidden" id="{{ choice.system_name }}-query-string" value="{{ choice.query_string }}"> | ||
{% endfor %} | ||
<div class="controls"> | ||
<input type="button" value="{% trans "Search" %}" onclick="datefilter_apply(event, '{{ choices.0.system_name }}-query-string', '{{ choices.0.system_name }}-form')"> | ||
<input type="reset" class="button" value="{% trans "Reset" %}" onclick="datefilter_reset('{{ choices.0.system_name }}-query-string')"> | ||
</div> | ||
</form> | ||
</div> | ||
</div> |