Add room and dates to tracks

They are required only for accepted and confirmed self-organized tracks
This commit is contained in:
AEtherC0r3 2017-07-12 15:56:07 +03:00 committed by Stella Rouzi
parent d616c66745
commit fd93b04f16
9 changed files with 99 additions and 2 deletions

View file

@ -8,10 +8,16 @@
Track
.row
.col-md-12
= semantic_form_for(@track, url: (@track.new_record? ? admin_conference_program_tracks_path : admin_conference_program_track_path(@conference.short_title, @track))) do |f|
= semantic_form_for(@track, url: (@track.new_record? ? admin_conference_program_tracks_path(@conference.short_title) : admin_conference_program_track_path(@conference.short_title, @track))) do |f|
= f.input :name
= f.input :short_name, hint: "A short and unique handle for the track, using only letters, numbers, underscores, and dashes. This will be used to identify the track in URLs etc. Example: 'my_awesome_track'", input_html: { required: 'required', pattern: '[a-zA-Z0-9_-]+', title: 'Only letters, numbers, underscores, and dashes.' }
= f.input :color, input_html: {size: 6, type: 'color'}, required: true
= f.input :start_date, as: :string, input_html: { id: 'registration-period-start-datepicker', start_date: @conference.start_date, end_date: @conference.end_date, readonly: 'readonly', required: @track.self_organized_and_accepted_or_confirmed? }
= f.input :end_date, as: :string, input_html: { id: 'registration-period-end-datepicker', readonly: 'readonly', required: @track.self_organized_and_accepted_or_confirmed? }
- if @conference.venue
= f.input :room, as: :select, collection: (@conference.venue.rooms).map {|room| ["#{room.name}", room.id]}, include_blank: true, label: 'Room', input_html: { class: 'select-help-toggle', required: @track.self_organized_and_accepted_or_confirmed? }
- else
Please add a venue with rooms, if you want to select a room for the track.
= f.input :description, input_html: {rows: 2, data: { provide: 'markdown-editable' } }, hint: markdown_hint
- if @track.self_organized?
= f.input :cfp_active, label: 'Allow event submitters to select this track for their proposal'

View file

@ -15,6 +15,9 @@
%th Color
%th State
%th Included in the Cfp
%th Room
%th Start Date
%th End Date
%th Actions
%tbody
- @tracks.each do |track|
@ -52,6 +55,21 @@
off_text: 'No' }
- else
%i.fa.fa-check
%td
- if track.room
= link_to track.room.name, admin_conference_venue_room_path(@conference.short_title, track.room.id)
- else
N/A
%td
- if track.start_date
= track.start_date.strftime('%A, %B %-d. %Y')
- else
N/A
%td
- if track.end_date
= track.end_date.strftime('%A, %B %-d. %Y')
- else
N/A
%td
.btn-group{role: "group"}
= link_to 'Edit', edit_admin_conference_program_track_path(@conference.short_title, track),