Cleaner URL when using the filter form

This commit is contained in:
echarp 2016-10-28 14:35:27 +02:00
parent d25e133b13
commit 778e44f12f
6 changed files with 75864 additions and 4 deletions

View 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

View File

@ -16,11 +16,13 @@
:markdown :markdown
#{t '.period_year_helper'} #{t '.period_year_helper'}
= label_tag 'period[year]', t('.period_year') = 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 .field.period_week
= label_tag 'period[week]', t('.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 .field.near_location
= label_tag 'near[location]', t('.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