Refactored proposal. Enabled cancancan

This commit is contained in:
Henne Vogelsang 2014-07-23 16:24:05 +02:00
parent 0ae7991943
commit c982cbb88a
13 changed files with 204 additions and 231 deletions

View file

@ -3,8 +3,8 @@
%h1
= "My Proposals for #{@conference.title}"
- if @conference.cfp_open? || organizer_or_admin?
= link_to "New Proposal", new_conference_proposal_path(@conference.short_title), :class => "btn btn-primary pull-right"
- if @user.proposal_count(@conference) > 0
= link_to "New Proposal", new_conference_proposal_path(@conference.short_title), :class => "btn btn-success pull-right"
- if current_user.proposal_count(@conference) > 0
.row
.col-md-12
%table.table.table-bordered.table-striped
@ -32,15 +32,15 @@
.pull-right
- if event.transition_possible? :confirm
= link_to 'Confirm',
conference_proposal_confirm_path(@conference.short_title, event),
confirm_conference_proposal_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}"
class: 'btn btn-mini btn-primary', id: "edit_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',
confirm: 'Are you sure you want to withdraw this proposal?', class: 'btn btn-mini btn-warning',
id: "delete_proposal_#{event.id}"
- if event.state == 'withdrawn' || event.state == 'rejected'
= link_to 'Re-Submit',
conference_proposal_restart_path(@conference.short_title, event),
restart_conference_proposal_path(@conference.short_title, event.id),
method: :patch, class: 'btn btn-mini btn-success', id: "review_event_#{event.id}"