Unlint CfP views #BetterPlace

This commit is contained in:
James Mason 2018-10-17 16:44:08 -07:00
parent 195d7e08ac
commit 21c5b842b1
11 changed files with 89 additions and 55 deletions

View file

@ -1,20 +1,20 @@
%dt
Type:
%dd
= @cfp.cfp_type.capitalize
= cfp.cfp_type.capitalize
%dt
Start Date:
%dd
= @cfp.start_date.strftime('%A, %B %e. %Y')
= cfp.start_date.strftime('%A, %B %e. %Y')
%dt
End Date:
%dd
= @cfp.end_date.strftime('%A, %B %e. %Y')
= cfp.end_date.strftime('%A, %B %e. %Y')
%dt
Description
%dd
= markdown(@cfp.description)
= markdown(cfp.description)
%dt
Days Left
%dd
= pluralize(@cfp.remaining_days, 'day')
= pluralize(cfp.remaining_days, 'day')

View file

@ -1,46 +1,46 @@
%dt
Type:
%dd
= @cfp.cfp_type.capitalize
= cfp.cfp_type.capitalize
%dt
Start Date:
%dd#start_date
= @cfp.start_date.strftime('%A, %B %-d. %Y')
%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')
%dd#end-date
= cfp.end_date.strftime('%A, %B %-d. %Y')
%dt
Description:
%dd#description
= markdown(@cfp.description)
= markdown(cfp.description)
%dt
Days Left:
%dd
= pluralize(@cfp.remaining_days, 'day')
= pluralize(cfp.remaining_days, 'day')
%dt
Event types:
%dd
= event_types_sentence(@conference)
= event_types_sentence(conference)
%dt
Tracks:
%dd
= tracks(@conference)
= tracks(conference)
%dt
Public Schedule:
%dd#schedule_public
- if @program.schedule_public
%dd#schedule-public
- if conference.program.schedule_public
Yes
- else
No
%dt
Schedule changeable?
%dd#schedule_changes
- if @program.schedule_fluid
%dd#schedule-changes
- if conference.program.schedule_fluid
Yes
- else
No
%dt
Rating Levels:
%dd#rating
= @program.rating
= conference.program.rating

View file

@ -4,10 +4,20 @@
%h1 Call for Papers
.row
.col-md-8
= 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' }
= f.input :description, input_html: {rows: 2, data: { provide: 'markdown-editable' } }, hint: markdown_hint
= semantic_form_for(cfp, url: cfp_form_url(cfp, conference),
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, include_blank: false,
collection: select_cfp_types(cfp, conference.program),
label: 'Type', input_html: { class: 'select-help-toggle' }
= f.input :description, hint: markdown_hint,
input_html: { rows: 2, data: { provide: 'markdown-editable' } }
%p.text-right
= f.action :submit, as: :button, button_html: { class: 'btn btn-primary' }
= f.action :submit, as: :button,
button_html: { class: 'btn btn-primary' }

View file

@ -1,20 +1,20 @@
%dt
Type:
%dd
= @cfp.cfp_type.capitalize
= cfp.cfp_type.capitalize
%dt
Start Date:
%dd#start_date
= @cfp.start_date.strftime('%A, %B %-d. %Y')
%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')
%dd#end-date
= cfp.end_date.strftime('%A, %B %-d. %Y')
%dt
Description:
%dd#description
= markdown(@cfp.description)
= markdown(cfp.description)
%dt
Days Left:
%dd
= pluralize(@cfp.remaining_days, 'day')
= pluralize(cfp.remaining_days, 'day')

View file

@ -0,0 +1 @@
= render 'form', cfp: @cfp, conference: @conference

View file

@ -19,8 +19,8 @@
- @program.cfps.each do |cfp|
%tr
%td
= link_to(admin_conference_program_cfp_path(@conference.short_title, cfp.id)) do
= cfp.cfp_type.capitalize
= link_to cfp.cfp_type.capitalize,
admin_conference_program_cfp_path(@conference, cfp)
%td
= cfp.start_date.strftime('%A, %B %-d. %Y')
%td
@ -32,9 +32,16 @@
= 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?' }
= link_to 'Edit',
edit_admin_conference_program_cfp_path(@conference, cfp),
method: :get, class: 'btn btn-primary'
= link_to 'Delete',
admin_conference_program_cfp_path(@conference, cfp),
method: 'delete', class: 'btn btn-danger',
data: { confirm: 'Are you sure?' }
- if can? :new, @program.cfps.new
.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'
= link_to 'Create Call for Papers',
new_admin_conference_program_cfp_path(@conference),
class: 'btn btn-primary'

View file

@ -0,0 +1 @@
= render 'form', cfp: @cfp, conference: @conference

View file

@ -7,10 +7,13 @@
.row
.col-md-8
%dl.dl-horizontal
= render "#{@cfp.cfp_type}_cfp"
= render "#{@cfp.cfp_type}_cfp", cfp: @cfp, conference: @conference
.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
= link_to 'Edit',
edit_admin_conference_program_cfp_path(@conference, @cfp),
class: 'btn btn-primary'
= link_to 'Delete',
admin_conference_program_cfp_path(@conference, @cfp),
method: 'delete', class: 'btn btn-danger',
data: { confirm: 'Are you sure you want to delete the CfP?' }