Implement track request acceptance

Allow track submitter to request specific dates
Redirect to Tracks#edit if a track doesn't have a room or start/end date
before accepting it

Don't allow the submitter or the track organizers to edit the request
after it has been accepted or confirmed

Restrict track selection in proposals and move track selection from
Proposals form to events helper

Mark cfp_active of the tracks table as not null and fill in true if nil
This commit is contained in:
AEtherC0r3 2017-07-14 15:57:34 +03:00 committed by Stella Rouzi
parent 2f9eb04219
commit d9faffc96a
27 changed files with 909 additions and 62 deletions

View file

@ -9,9 +9,11 @@
Track
.row
.col-md-12
= semantic_form_for(@track, url: (@track.new_record? ? conference_program_tracks_path : conference_program_track_path(@conference.short_title, @track))) do |f|
= semantic_form_for(@track, url: (@track.new_record? ? conference_program_tracks_path(@conference.short_title) : 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' }
= f.input :end_date, as: :string, input_html: { id: 'registration-period-end-datepicker', readonly: 'readonly' }
= f.input :description, input_html: {rows: 2, data: { provide: 'markdown-editable' } }, required: true, hint: markdown_hint
= f.action :submit, as: :button, button_html: { class: 'btn btn-primary' }

View file

@ -16,6 +16,8 @@
%th Description
%th Color
%th State
%th Start Date
%th End Date
%th Actions
%tbody
- @tracks.each do |track|
@ -34,10 +36,31 @@
%td
= track.state.humanize
%td
= link_to 'Edit', edit_conference_program_track_path(@conference.short_title, track),
method: :get, class: 'btn btn-primary'
- 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
- if track.transition_possible? :confirm
= link_to 'Confirm', confirm_conference_program_track_path(@conference.short_title, track),
method: :patch, class: 'btn btn-mini btn-success', id: "confirm_track_#{track.id}"
- if track.transition_possible? :withdraw
= link_to 'Withdraw', withdraw_conference_program_track_path(@conference.short_title, track),
method: :patch, data: { confirm: 'Are you sure you want to withdraw this track request?' },
class: 'btn btn-mini btn-warning', id: "withdraw_track_request_#{track.id}"
- if track.transition_possible? :restart
= link_to 'Re-Submit', restart_conference_program_track_path(@conference.short_title, track),
method: :patch, class: 'btn btn-mini btn-success', id: "resubmit_track_request_#{track.id}"
- if can? :edit, track
= link_to 'Edit', edit_conference_program_track_path(@conference.short_title, track),
method: :get, class: 'btn btn-primary'
.row
.col-md-12
- if can? :create, @track
- if can? :new, @program.tracks.new
= link_to "New Track request", new_conference_program_track_path(@conference.short_title), class: 'btn btn-success pull-right'

View file

@ -17,10 +17,25 @@
State:
%dd
= @track.state.humanize
%dt
Start date:
%dd
- if @track.start_date
= @track.start_date.strftime('%A, %B %-d. %Y')
- else
N/A
%dt
End date:
%dd
- if @track.end_date
= @track.end_date.strftime('%A, %B %-d. %Y')
- else
N/A
%dt
Description
%dd
= @track.description
.row
.col-md-12.text-right
= link_to 'Edit Track request', edit_conference_program_track_path(@conference.short_title, @track), class: 'btn btn-primary'
- if can? :edit, @track
= link_to 'Edit Track request', edit_conference_program_track_path(@conference.short_title, @track), class: 'btn btn-primary'