GUI for filter by creation date #1343

This commit is contained in:
Alexandr Danilov 2015-08-17 03:12:14 +03:00
parent 6fd3d82c01
commit 790d18a319
2 changed files with 19 additions and 2 deletions

View file

@ -74,17 +74,27 @@
<div class="col s12"> <div class="col s12">
<label>{% trans %}Reading time in minutes{% endtrans %}</label> <label>{% trans %}Reading time in minutes{% endtrans %}</label>
</div> </div>
<div class="input-field col s6"> <div class="input-field col s6">
{{ form_widget(form.readingTime.left_number, {'type': 'number'}) }} {{ form_widget(form.readingTime.left_number, {'type': 'number'}) }}
<label for="entry_filter_readingTime_left_number">{% trans %}from{% endtrans %}</label> <label for="entry_filter_readingTime_left_number">{% trans %}from{% endtrans %}</label>
</div> </div>
<div class="input-field col s6"> <div class="input-field col s6">
{{ form_widget(form.readingTime.right_number, {'type': 'number'}) }} {{ form_widget(form.readingTime.right_number, {'type': 'number'}) }}
<label for="entry_filter_readingTime_right_number">{% trans %}to{% endtrans %}</label> <label for="entry_filter_readingTime_right_number">{% trans %}to{% endtrans %}</label>
</div> </div>
<div class="col s12">
<label>{% trans %}Create at{% endtrans %}</label>
</div>
<div class="input-field col s6">
{{ form_widget(form.createdAt.left_date, {'type': 'date', 'attr': {'class': 'datepicker', 'data-value': form.createdAt.left_date.vars.value} }) }}
<label for="entry_filter_createdAt_left_date" class="active">{% trans %}from{% endtrans %}</label>
</div>
<div class="input-field col s6">
{{ form_widget(form.createdAt.right_date, {'type': 'date', 'attr': {'class': 'datepicker', 'data-value': form.createdAt.left_date.vars.value} }) }}
<label for="entry_filter_createdAt_right_date" class="active">{% trans %}to{% endtrans %}</label>
</div>
<div class="col s6"> <div class="col s6">
<a href="#!" class="center waves-effect waves-green btn-flat" id="clean_form_filters">{% trans %}Clean{% endtrans %}</a> <a href="#!" class="center waves-effect waves-green btn-flat" id="clean_form_filters">{% trans %}Clean{% endtrans %}</a>
</div> </div>

View file

@ -17,6 +17,13 @@ $(document).ready(function(){
$('.collapsible').collapsible({ $('.collapsible').collapsible({
accordion : false accordion : false
}); });
$('.datepicker').pickadate({
selectMonths: true,
selectYears: 15,
formatSubmit: 'dd/mm/yyyy',
hiddenName: true,
format: 'dd/mm/yyyy',
});
init_filters(); init_filters();
$('#nav-btn-add').on('click', function(){ $('#nav-btn-add').on('click', function(){