mirror of
https://github.com/openSUSE/osem.git
synced 2026-08-13 19:54:02 +00:00
Allow users to confirm their proposal
This commit is contained in:
parent
3181c1c0d8
commit
a9207671b8
3 changed files with 26 additions and 2 deletions
|
|
@ -1,9 +1,12 @@
|
||||||
class ProposalController < ApplicationController
|
class ProposalController < ApplicationController
|
||||||
before_filter :verify_user
|
before_filter :verify_user
|
||||||
before_filter :verify_access, :only => [:edit, :update, :destroy]
|
before_filter :verify_access, :only => [:edit, :update, :destroy, :confirm]
|
||||||
|
|
||||||
def verify_access
|
def verify_access
|
||||||
@person = current_user.person
|
@person = current_user.person
|
||||||
|
if params.has_key? :proposal_id
|
||||||
|
params[:id] = params[:proposal_id]
|
||||||
|
end
|
||||||
begin
|
begin
|
||||||
if !organizer_or_admin?
|
if !organizer_or_admin?
|
||||||
@event = @person.event.find(params[:id])
|
@event = @person.event.find(params[:id])
|
||||||
|
|
@ -105,4 +108,24 @@ class ProposalController < ApplicationController
|
||||||
def show
|
def show
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def confirm
|
||||||
|
if @event.transition_possible? :confirm
|
||||||
|
begin
|
||||||
|
@event.confirm!
|
||||||
|
rescue Exception => e
|
||||||
|
redirect_to(conference_proposal_index_path(:conference_id => @conference.short_title), :alert => 'Event was NOT confirmed: #{e.message}')
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
|
if !@conference.user_registered?(current_user)
|
||||||
|
redirect_to(register_conference_path(@conference.short_title), :notice => "Event was confirmed. Please register to attend the conference.")
|
||||||
|
return
|
||||||
|
end
|
||||||
|
redirect_to(conference_proposal_index_path(:conference_id => @conference.short_title), :notice => 'Event was confirmed.')
|
||||||
|
else
|
||||||
|
redirect_to(conference_proposal_index_path(:conference_id => @conference.short_title), :alert => 'Event was NOT confirmed!')
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -27,7 +27,7 @@
|
||||||
%td
|
%td
|
||||||
.pull-right
|
.pull-right
|
||||||
- if event.transition_possible? :confirm
|
- if event.transition_possible? :confirm
|
||||||
= link_to "Confirm", "#", :class => "btn btn-mini btn-success"
|
= link_to "Confirm", conference_proposal_confirm_path(@conference.short_title, event), :method => :put, :class => "btn btn-mini btn-success"
|
||||||
- if @conference.cfp_open?
|
- if @conference.cfp_open?
|
||||||
- if !event.unconfirmed? && !event.confirmed?
|
- if !event.unconfirmed? && !event.confirmed?
|
||||||
= link_to "Edit", edit_conference_proposal_path(@conference.short_title, event.id), :class => "btn btn-mini btn-primary"
|
= link_to "Edit", edit_conference_proposal_path(@conference.short_title, event.id), :class => "btn btn-mini btn-primary"
|
||||||
|
|
|
||||||
|
|
@ -33,6 +33,7 @@ Osem::Application.routes.draw do
|
||||||
resources :conference, :only => [] do
|
resources :conference, :only => [] do
|
||||||
resources :proposal do
|
resources :proposal do
|
||||||
resources :event_attachment, :controller => "EventAttachments"
|
resources :event_attachment, :controller => "EventAttachments"
|
||||||
|
put "/confirm" => "proposal#confirm"
|
||||||
end
|
end
|
||||||
member do
|
member do
|
||||||
get "/register" => "ConferenceRegistration#register"
|
get "/register" => "ConferenceRegistration#register"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue