Replace registration-period datepickers with date input

Nowadays all browsers have reasonable date input support...
This commit is contained in:
Henne Vogelsang 2024-06-06 21:52:39 +02:00
parent f4d9561eaa
commit 07bfff8fa1
No known key found for this signature in database
GPG key ID: 97DDB66BDAF8D4D6
7 changed files with 39 additions and 68 deletions

View file

@ -2,10 +2,12 @@
= f.hidden_field :cfp_type
.form-group
= f.label :start_date, "Start Date"
= f.text_field :start_date, class: 'form-control', id: 'registration-period-start-datepicker', start_date: @conference.start_date, end_date: @conference.end_date
%abbr{title: 'This field is required'} *
= f.date_field :start_date, class: 'form-control', required: true
.form-group
= f.label :end_date, "End Date"
= f.text_field :end_date, class: 'form-control', id: 'registration-period-end-datepicker', start_date: @conference.start_date, end_date: @conference.end_date
%abbr{title: 'This field is required'} *
= f.date_field :end_date, class: 'form-control', required: true
.form-group
= f.label :description, "Description"
= f.text_area :description, rows: 2, data: { provide: 'markdown' }

View file

@ -1,11 +1,20 @@
%p
Setup the time frame in which people can registrer to your conference
= form_for(@registration_period, url: admin_conference_registration_period_path(@conference.short_title)) do |f|
.form-group
= f.label :start_date
%abbr{title: 'This field is required'} *
= f.text_field :start_date, required: true, 'data-end-conference': @conference.end_date.to_s, id: 'registration-period-start-datepicker', class: 'form-control'
%p.small
Must be before conference end (#{@conference.end_date}) and the end date
- if @registration_period.end_date
(#{@registration_period.end_date})
below
= f.date_field :start_date, required: true, class: 'form-control', max: @conference.end_date, required: true
.form-group
= f.label :end_date
%abbr{title: 'This field is required'} *
= f.text_field :end_date, required: true, id: 'registration-period-end-datepicker', class: 'form-control'
%p.small
Must be before conference end (#{@conference.end_date})
= f.date_field :end_date, required: true, class: 'form-control', max: @conference.end_date, required: true
%p.text-right
= f.submit 'Save Registration Period', class: 'btn btn-primary'