71 lines
2.3 KiB
HTML
71 lines
2.3 KiB
HTML
{% load i18n admin_static %}
|
|
<h3>{% blocktrans with filter_title=title %} By {{ filter_title }} {% endblocktrans %}</h3>
|
|
<style>
|
|
.button, input[type=reset] {
|
|
background: #79aec8;
|
|
padding: 10px 15px;
|
|
border: none;
|
|
border-radius: 4px;
|
|
color: #fff;
|
|
cursor: pointer;
|
|
}
|
|
.admindatefilter {
|
|
padding-left: 15px;
|
|
padding-bottom: 10px;
|
|
border-bottom: 1px solid #eaeaea;
|
|
}
|
|
.admindatefilter p {
|
|
padding-left: 0px;
|
|
line-height: 0;
|
|
}
|
|
.admindatefilter .timezonewarning {
|
|
display: none;
|
|
}
|
|
.admindatefilter .datetimeshortcuts a:first-child {
|
|
margin-right: 4px;
|
|
display: none;
|
|
}
|
|
.calendarbox, .clockbox {
|
|
z-index: 1100;
|
|
margin-left: -16em !important;
|
|
margin-top: 9em !important;
|
|
}
|
|
.admindatefilter .datetimeshortcuts {
|
|
font-size: 0;
|
|
float: right;
|
|
position: absolute;
|
|
padding-top: 4px;
|
|
}
|
|
.admindatefilter a {
|
|
color: #999;
|
|
position: absolute;
|
|
padding-top: 3px;
|
|
padding-left: 4px;
|
|
}
|
|
</style>
|
|
<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="admindatefilter">
|
|
<form method="GET" action="." id="{{ choices.0.system_name }}-form">
|
|
{{ spec.form.media }}
|
|
{{ spec.form.as_p }}
|
|
{% for choice in choices %}
|
|
<input type="hidden" id="{{ choice.system_name }}-query-string" value="{{ choice.query_string }}">
|
|
{% endfor %}
|
|
<div class="controls">
|
|
<input type="submit" 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>
|