Refactoring event states
This commit is contained in:
parent
a95a03c7e5
commit
e5b588df81
12 changed files with 148 additions and 87 deletions
|
|
@ -19,7 +19,10 @@
|
|||
%td
|
||||
= link_to event.title, conference_proposal_path(@conference.short_title, event.id)
|
||||
%td
|
||||
= event.public_state
|
||||
- if event.state == 'new'
|
||||
Review pending
|
||||
- else
|
||||
= event.state.humanize
|
||||
- if event.state == 'confirmed' && event.require_registration == true
|
||||
(Pre-registered: #{pre_registered(event).count})
|
||||
- if event.confirmed? && !@conference.user_registered?(current_user)
|
||||
|
|
@ -29,10 +32,15 @@
|
|||
.pull-right
|
||||
- if event.transition_possible? :confirm
|
||||
= link_to 'Confirm',
|
||||
conference_proposal_confirm_path(@conference.short_title, event, send_mail: false),
|
||||
conference_proposal_confirm_path(@conference.short_title, event),
|
||||
method: :patch, class: 'btn btn-mini btn-success', id: "confirm_proposal_#{event.id}"
|
||||
= link_to 'Edit', edit_conference_proposal_path(@conference.short_title, event.id),
|
||||
class: 'btn btn-mini btn-primary', id: "edit_proposal_#{event.id}"
|
||||
= link_to 'Withdraw', conference_proposal_path(@conference.short_title, event.id), method: :delete,
|
||||
confirm: 'Are you sure you want to withdraw this proposal?', class: 'btn btn-mini btn-danger',
|
||||
id: "delete_proposal_#{event.id}"
|
||||
- if event.transition_possible? :withdraw
|
||||
= link_to 'Withdraw', conference_proposal_path(@conference.short_title, event.id), method: :delete,
|
||||
confirm: 'Are you sure you want to withdraw this proposal?', class: 'btn btn-mini btn-danger',
|
||||
id: "delete_proposal_#{event.id}"
|
||||
- if event.state == 'withdrawn' || event.state == 'rejected'
|
||||
= link_to 'Re-Submit',
|
||||
conference_proposal_restart_path(@conference.short_title, event),
|
||||
method: :patch, class: 'btn btn-mini btn-success', id: "review_event_#{event.id}"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue