Merge pull request #115 from ChrisBr/fix_confirm_event

Fix accept event workflow
This commit is contained in:
Christian Bruckmayer
2014-05-13 11:13:32 +02:00
4 changed files with 30 additions and 24 deletions

View File

@@ -113,12 +113,10 @@ class Admin::EventsController < ApplicationController
flash[:notice] = "Update not successful."
end
expire_page :controller => '/schedule', :action => :index
redirect_back_or_to(admin_conference_event_path(@conference.short_title, @event))
end
def create
expire_page :controller => '/schedule', :action => :index
end
def update_state
@@ -127,7 +125,6 @@ class Admin::EventsController < ApplicationController
redirect_to(admin_conference_events_path(:conference_id => @conference.short_title), :notice => "Update Email Template before Sending Mails") and return
end
event.send(:"#{params[:transition]}!", :send_mail => params[:send_mail])
expire_page :controller => '/schedule', :action => :index
redirect_to(admin_conference_events_path(:conference_id => @conference.short_title), :notice => "Updated state")
end

View File

@@ -47,7 +47,6 @@ class Admin::ScheduleController < ApplicationController
startTime = DateTime.strptime(time, "%Y-%m-%d %k:%M")
event.start_time = startTime
event.save!
expire_page :controller => '/schedule', :action => :index
render :json => {"status" => "ok"}
end

View File

@@ -106,26 +106,35 @@
<b class="caret"></b>
%ul.dropdown-menu
- if event.transition_possible? :accept
%li= link_to "Accept event (no email)", update_state_admin_conference_event_path(@conference.short_title, event, :transition => :accept, :send_mail => false),
:method => :put, :hint => "Accept this event without sending an automated email."
%li= link_to "Accept event (WITH email)", update_state_admin_conference_event_path(@conference.short_title, event, :transition => :accept, :send_mail => true),
:method => :put, :hint => "Accept this event and send an automated email."
%li= link_to 'Accept event (no email)',
update_state_admin_conference_event_path(@conference.short_title, event, transition: :accept, send_mail: false),
method: :patch, hint: 'Accept this event without sending an automated email.'
%li= link_to 'Accept event (WITH email)',
update_state_admin_conference_event_path(@conference.short_title, event, transition: :accept, send_mail: true),
method: :patch, hint: 'Accept this event and send an automated email.'
- if event.transition_possible? :reject
%li= link_to "Reject event (no email)", update_state_admin_conference_event_path(@conference.short_title, event, :transition => :reject, :send_mail => false),
:method => :put, :confirm => "Are you sure?",
:hint => "Reject this event without sending an automated email."
%li= link_to "Reject event (WITH email)", update_state_admin_conference_event_path(@conference.short_title, event, :transition => :reject, :send_mail => true),
:method => :put, :confirm => "Are you sure?",
:hint => "Reject this event and send an automated email."
%li= link_to 'Reject event (no email)',
update_state_admin_conference_event_path(@conference.short_title, event, transition: :reject, send_mail: false),
method: :patch, confirm: 'Are you sure?',
hint: 'Reject this event without sending an automated email.'
%li= link_to 'Reject event (WITH email)',
update_state_admin_conference_event_path(@conference.short_title, event, transition: :reject, send_mail: true),
method: :patch, confirm: 'Are you sure?',
hint: 'Reject this event and send an automated email.'
- if event.transition_possible? :start_review
%li= link_to "Start review", update_state_admin_conference_event_path(@conference.short_title, event, :transition => :start_review),
:method => :put
%li= link_to 'Start review',
update_state_admin_conference_event_path(@conference.short_title, event, transition: :start_review),
method: :patch
- if event.transition_possible? :confirm
%li= link_to "Confirm event", update_state_admin_conference_event_path(@conference.short_title, event, :transition => :confirm),
:method => :put, :hint => "Confirm that the speaker(s) will be present and that the event will actually take place."
%li= link_to 'Confirm event',
update_state_admin_conference_event_path(@conference.short_title, event, transition: :confirm),
method: :patch,
hint: 'Confirm that the speaker(s) will be present and that the event will actually take place.'
- if event.transition_possible? :cancel
%li= link_to "Cancel event", update_state_admin_conference_event_path(@conference.short_title, event, :transition => :cancel),
:method => :put, :hint => "Mark this event as cancelled. Usually this means that the speakers had to cancel their appearance."
%li= link_to 'Cancel event',
update_state_admin_conference_event_path(@conference.short_title, event, :transition => :cancel),
method: :patch,
hint: 'Mark this event as cancelled. Usually this means that the speakers had to cancel their appearance.'
:javascript
$(document).ready(function() {

View File

@@ -28,7 +28,8 @@
%td
.pull-right
- if event.transition_possible? :confirm
= link_to "Confirm", conference_proposal_confirm_path(@conference.short_title, event, :send_mail=>false), :method => :put, :class => "btn btn-mini btn-success"
= link_to "Edit", edit_conference_proposal_path(@conference.short_title, event.id), :class => "btn btn-mini btn-primary"
= 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"
= link_to 'Confirm',
conference_proposal_confirm_path(@conference.short_title, event, send_mail: false), method: :patch, class: 'btn btn-mini btn-success'
= link_to 'Edit', edit_conference_proposal_path(@conference.short_title, event.id), class: 'btn btn-mini btn-primary'
= 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'