Cleaner URL when using the filter form

rails5
echarp 6 years ago
parent d25e133b13
commit 778e44f12f
  1. 9
      app/assets/javascripts/filter.js.coffee
  2. 6
      app/views/application/filter.haml
  3. 2
      public/assets/.sprockets-manifest-ab661426d97300c73ef9f54813a90d69.json
  4. 2
      public/assets/.sprockets-manifest-cc0c9f43a35675d2248a689be654ce22.json
  5. 75849
      public/assets/application-08422740ca00279c6943824b28f3ae60c79bb9d2d19657f0fbce3a76c6712e28.js
  6. BIN
      public/assets/application-08422740ca00279c6943824b28f3ae60c79bb9d2d19657f0fbce3a76c6712e28.js.gz

@ -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
Loading…
Cancel
Save