Cleaner URL when using the filter form
This commit is contained in:
parent
d25e133b13
commit
778e44f12f
9
app/assets/javascripts/filter.js.coffee
Normal file
9
app/assets/javascripts/filter.js.coffee
Normal file
@ -0,0 +1,9 @@
|
||||
# Cleans up filter submission, for cleaner URL
|
||||
$(document).on 'turbolinks:load', ->
|
||||
$('body.filter form :input').prop 'disabled', false
|
||||
|
||||
$('body.filter form').submit ->
|
||||
$('input[name=utf8]').prop 'disabled', true
|
||||
$(':input', this).filter ->
|
||||
this.value.length == 0
|
||||
.prop 'disabled', true
|
@ -16,11 +16,13 @@
|
||||
:markdown
|
||||
#{t '.period_year_helper'}
|
||||
= label_tag 'period[year]', t('.period_year')
|
||||
= number_field_tag 'period[year]', (Time.zone.today + 7.days).year
|
||||
= number_field_tag 'period[year]', params['period[year]'],
|
||||
placeholder: "Ex: #{(Time.zone.today + 7.days).year}"
|
||||
|
||||
.field.period_week
|
||||
= label_tag 'period[week]', t('.period_week')
|
||||
= number_field_tag 'period[week]', (Time.zone.today + 7.days).cweek
|
||||
= number_field_tag 'period[week]', params['period[week]'],
|
||||
placeholder: "Ex: #{(Time.zone.today + 7.days).cweek}"
|
||||
|
||||
.field.near_location
|
||||
= label_tag 'near[location]', t('.near_location')
|
||||
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Binary file not shown.
Loading…
Reference in New Issue
Block a user