Add index view for the cfp and modify existing ones

Add cfp_type to the form partial
Refactor Cfps#show to use partials for the different cfp types
Modify the rest of the view, where the cfp was used
This commit is contained in:
AEtherC0r3 2017-05-31 21:03:15 +03:00 committed by Stella Rouzi
parent c3eb178546
commit 2bff918556
10 changed files with 107 additions and 67 deletions

View file

@ -4,8 +4,9 @@
%h1 Call for Papers
.row
.col-md-8
= semantic_form_for(@cfp, url: admin_conference_program_cfp_path(@conference.short_title), html: {multipart: true}) do |f|
= semantic_form_for(@cfp, url: (@cfp.new_record? ? admin_conference_program_cfps_path : admin_conference_program_cfp_path(@conference.short_title, @cfp)), html: {multipart: true}) do |f|
= 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 :cfp_type, as: :select, collection: (@cfp.new_record? ? @program.remaining_cfp_types : [@cfp.cfp_type] + @program.remaining_cfp_types).map {|type| ["#{type.capitalize}", type]}, include_blank: false, label: 'Type', input_html: { class: 'select-help-toggle' }
%p.text-right
= f.action :submit, as: :button, button_html: { class: 'btn btn-primary' }