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:
parent
c3eb178546
commit
2bff918556
10 changed files with 107 additions and 67 deletions
38
app/views/admin/cfps/_events_cfp.html.haml
Normal file
38
app/views/admin/cfps/_events_cfp.html.haml
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
%dt
|
||||
Start Date:
|
||||
%dd#start_date
|
||||
= @cfp.start_date.strftime('%A, %B %-d. %Y')
|
||||
%dt
|
||||
End Date:
|
||||
%dd#end_date
|
||||
= @cfp.end_date.strftime('%A, %B %-d. %Y')
|
||||
%dt
|
||||
Days Left:
|
||||
%dd
|
||||
= pluralize(@cfp.remaining_days, 'day')
|
||||
%dt
|
||||
Event types:
|
||||
%dd
|
||||
= event_types(@conference)
|
||||
%dt
|
||||
Tracks:
|
||||
%dd
|
||||
= tracks(@conference)
|
||||
%dt
|
||||
Public Schedule
|
||||
%dd#schedule_public
|
||||
- if @program.schedule_public
|
||||
Yes
|
||||
- else
|
||||
No
|
||||
%dt
|
||||
Schedule changeable?
|
||||
%dd#schedule_changes
|
||||
- if @program.schedule_fluid
|
||||
Yes
|
||||
- else
|
||||
No
|
||||
%dt
|
||||
Rating Levels
|
||||
%dd#rating
|
||||
= @program.rating
|
||||
|
|
@ -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' }
|
||||
|
|
|
|||
36
app/views/admin/cfps/index.html.haml
Normal file
36
app/views/admin/cfps/index.html.haml
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
.row
|
||||
.col-md-12
|
||||
.page-header
|
||||
%h1 Call for Papers
|
||||
%p.text-muted
|
||||
Call for people to submit events to your conference
|
||||
- if @program.cfps
|
||||
.row
|
||||
.col-md-12
|
||||
%table.table.table-hover.datatable#tickets
|
||||
%thead
|
||||
%th Type
|
||||
%th Start Date
|
||||
%th End Date
|
||||
%th Days Left
|
||||
%th Actions
|
||||
%tbody
|
||||
- @program.cfps.each do |cfp|
|
||||
%tr
|
||||
%td
|
||||
= link_to(admin_conference_program_cfp_path(@conference.short_title, cfp.id)) do
|
||||
= cfp.cfp_type.capitalize
|
||||
%td
|
||||
= cfp.start_date.strftime('%A, %B %-d. %Y')
|
||||
%td
|
||||
= cfp.end_date.strftime('%A, %B %-d. %Y')
|
||||
%td
|
||||
= pluralize(cfp.remaining_days, 'day')
|
||||
%td
|
||||
.btn-group
|
||||
= link_to 'Edit', edit_admin_conference_program_cfp_path(@conference.short_title, cfp.id), method: :get, class: 'btn btn-primary'
|
||||
= link_to 'Delete', admin_conference_program_cfp_path(@conference.short_title, cfp.id), method: 'delete', class: 'btn btn-danger', data: { confirm: 'Are you sure you want to delete the CfP?' }
|
||||
- if @program.remaining_cfp_types.length > 0
|
||||
.row
|
||||
.col-md-12.text-right
|
||||
= link_to 'Create Call for Papers', new_admin_conference_program_cfp_path(@conference.short_title), class: 'btn btn-primary'
|
||||
|
|
@ -4,55 +4,13 @@
|
|||
%h1 Call for Papers
|
||||
%p.text-muted
|
||||
Call for people to submit events to your conference
|
||||
- if @cfp
|
||||
.row
|
||||
.col-md-8
|
||||
%dl.dl-horizontal
|
||||
%dt
|
||||
Start Date:
|
||||
%dd#start_date
|
||||
= @cfp.start_date.strftime('%A, %B %-d. %Y')
|
||||
%dt
|
||||
End Date:
|
||||
%dd#end_date
|
||||
= @cfp.end_date.strftime('%A, %B %-d. %Y')
|
||||
%dt
|
||||
Days Left:
|
||||
%dd
|
||||
= pluralize(@cfp.remaining_days, 'day')
|
||||
%dt
|
||||
Event types:
|
||||
%dd
|
||||
= event_types(@conference)
|
||||
%dt
|
||||
Tracks:
|
||||
%dd
|
||||
= tracks(@conference)
|
||||
%dt
|
||||
Public Schedule
|
||||
%dd#schedule_public
|
||||
- if @program.schedule_public
|
||||
Yes
|
||||
- else
|
||||
No
|
||||
%dt
|
||||
Schedule changeable?
|
||||
%dd#schedule_changes
|
||||
- if @program.schedule_fluid
|
||||
Yes
|
||||
- else
|
||||
No
|
||||
%dt
|
||||
Rating Levels
|
||||
%dd#rating
|
||||
= @program.rating
|
||||
.row
|
||||
.col-md-12.text-right
|
||||
= link_to(edit_admin_conference_program_cfp_path(@conference.short_title), class: 'btn btn-primary') do
|
||||
Edit
|
||||
= link_to(admin_conference_program_cfp_path(@conference.short_title), method: 'delete', class: 'btn btn-danger', data: { confirm: 'Are you sure you want to delete the CfP?' }) do
|
||||
Delete
|
||||
- else
|
||||
.row
|
||||
.col-md-12.text-right
|
||||
= link_to 'Create Call for Papers', new_admin_conference_program_cfp_path(@conference.short_title), class: 'btn btn-primary'
|
||||
.row
|
||||
.col-md-8
|
||||
%dl.dl-horizontal
|
||||
= render "#{@cfp.cfp_type}_cfp"
|
||||
.row
|
||||
.col-md-12.text-right
|
||||
= link_to(edit_admin_conference_program_cfp_path(@conference.short_title, @cfp.id), class: 'btn btn-primary') do
|
||||
Edit
|
||||
= link_to(admin_conference_program_cfp_path(@conference.short_title, @cfp.id), method: 'delete', class: 'btn btn-danger', data: { confirm: 'Are you sure you want to delete the CfP?' }) do
|
||||
Delete
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@
|
|||
%li{ 'class' => "list-group-item #{hidden_if_conference_over(conference)} #{class_for_todo(conference_progress['cfp'])}" }
|
||||
%span{ 'class' => icon_for_todo(conference_progress['cfp']) }
|
||||
- if can? :update, Cfp.new(program_id: @program.id)
|
||||
= link_to 'Set up call for papers', admin_conference_program_cfp_path(conference_progress['short_title'])
|
||||
= link_to 'Set up call for papers', admin_conference_program_cfps_path(conference_progress['short_title'])
|
||||
- else
|
||||
Set up call for papers
|
||||
%li{'class'=>"list-group-item #{hidden_if_conference_over(conference)} #{class_for_todo(conference_progress['venue'])}"}
|
||||
|
|
|
|||
|
|
@ -85,8 +85,10 @@
|
|||
admin_conference_program_path(conference_id: Conference.find(version.conference_id).short_title)
|
||||
|
||||
- when 'Cfp'
|
||||
= link_if_alive version, 'cfp',
|
||||
admin_conference_program_cfp_path(conference_id: Conference.find(version.conference_id).short_title)
|
||||
= 'cfp'
|
||||
- cfp = current_or_last_object_state(version.item_type, version.item_id)
|
||||
= link_if_alive version, cfp.cfp_type,
|
||||
admin_conference_program_cfp_path(conference_id: Conference.find(version.conference_id).short_title, id: version.item_id)
|
||||
|
||||
- when 'Track'
|
||||
= 'track'
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue