Merge pull request #84 from ChrisBr/fix_formes

Fix formes
This commit is contained in:
Artem Chernikov 2014-04-29 23:34:16 +02:00
commit b7df014e35
15 changed files with 66 additions and 62 deletions

View file

@ -1,7 +1,7 @@
class Admin::CallforpapersController < ApplicationController
before_filter :verify_organizer
def show
def index
@cfp = @conference.call_for_papers
if @cfp.nil?
@cfp = CallForPapers.new
@ -11,17 +11,22 @@ class Admin::CallforpapersController < ApplicationController
def update
@cfp = @conference.call_for_papers
@cfp.update_attributes(params[:call_for_papers])
redirect_to(admin_conference_cfp_info_path(:id => @conference.short_title), :notice => 'Call for Papers was successfully updated.')
redirect_to(admin_conference_callforpapers_path(
id: @conference.short_title),
notice: 'Call for Papers was successfully updated.')
end
def create
@cfp = CallForPapers.new(params[:call_for_papers])
@cfp = CallForPapers.new(params[:call_for_papers])
@conference.call_for_papers = @cfp
if @cfp.save
redirect_to(admin_conference_cfp_info_path(:id => @conference.short_title), :notice => 'Call for Papers was successfully updated.')
redirect_to(admin_conference_callforpapers_path(
id: @conference.short_title),
notice: 'Call for Papers was successfully updated.')
else
redirect_to(admin_conference_cfp_info_path(:id => @conference.short_title), :error => 'Call for Papers failed.')
redirect_to(admin_conference_callforpapers_path(
id: @conference.short_title),
error: 'Call for Papers failed.')
end
end
end

View file

@ -3,11 +3,12 @@ class Admin::EmailsController < ApplicationController
def update
@conference.email_settings.update_attributes(params[:email_settings])
redirect_to(admin_conference_email_settings_path(@conference.short_title), :notice => 'Settings have been successfully updated.')
redirect_to(admin_conference_emails_path(
@conference.short_title),
notice: 'Settings have been successfully updated.')
end
def show
def index
@settings = @conference.email_settings
end
end

View file

@ -2,15 +2,17 @@ class Admin::EventtypeController < ApplicationController
before_filter :verify_organizer
def show
render :event_type_list
render :eventtype_list
end
def update
begin
@conference.update_attributes!(params[:conference])
redirect_to(admin_conference_eventtype_list_path(:conference_id => @conference.short_title), :notice => 'Event types were successfully updated.')
rescue Exception => e
redirect_to(admin_conference_eventtype_list_path(:conference_id => @conference.short_title), :alert => 'Event types update failed: #{e.message}')
end
@conference.update_attributes!(params[:conference])
redirect_to(admin_conference_eventtype_path(
conference_id: @conference.short_title),
notice: 'Event types were successfully updated.')
rescue Exception => e
redirect_to(admin_conference_eventtype_path(
conference_id: @conference.short_title),
alert: 'Event types update failed: #{e.message}')
end
end
end

View file

@ -7,11 +7,13 @@ class Admin::RoomsController < ApplicationController
def update
if @conference.update_attributes(params[:conference])
redirect_to(admin_conference_rooms_list_path(:conference_id => @conference.short_title), :notice => 'Rooms were successfully updated.')
redirect_to(admin_conference_rooms_path(
conference_id: @conference.short_title),
notice: 'Rooms were successfully updated.')
else
redirect_to(admin_conference_rooms_list_path(:conference_id => @conference.short_title), :notice => 'Room update failed.')
redirect_to(admin_conference_rooms_path(
conference_id: @conference.short_title),
notice: 'Room update failed.')
end
end
end

View file

@ -3,18 +3,20 @@ class Admin::TracksController < ApplicationController
def show
respond_to do |format|
format.html { render :tracks_list}
format.json { render :json => @conference.tracks.to_json }
format.html { render :tracks_list }
format.json { render json: @conference.tracks.to_json }
end
end
def update
if @conference.update_attributes(params[:conference])
redirect_to(admin_conference_tracks_list_path(:conference_id => @conference.short_title), :notice => 'Tracks were successfully updated.')
redirect_to(admin_conference_tracks_path(
conference_id: @conference.short_title),
notice: 'Tracks were successfully updated.')
else
redirect_to(admin_conference_tracks_list_path(:conference_id => @conference.short_title), :notice => 'Tracks update failed.')
redirect_to(admin_conference_tracks_path(
conference_id: @conference.short_title),
notice: 'Tracks update failed.')
end
end
end

View file

@ -2,7 +2,7 @@
.col-md-3
= render 'admin/conference/sidebar'
.col-md-9
= semantic_form_for(@cfp, :url => admin_conference_cfp_update_path(@conference.short_title),:html => {:multipart => true}) do |f|
= semantic_form_for(@cfp, :url => admin_conference_callforpaper_path(@conference.short_title, @conference.call_for_papers),:html => {:multipart => true}) do |f|
= f.input :start_date, :as => :string, :input_html => { :id => "conference-start-datepicker", :readonly => "readonly" }
= f.input :end_date, :as => :string, :input_html => { :id => "conference-end-datepicker", :readonly => "readonly" }
= f.input :hard_deadline, :as => :string, :input_html => { :id => "cfp-hard-datepicker", :readonly => "readonly" }

View file

@ -4,22 +4,22 @@
= link_to "Conference", admin_conference_path(@conference.short_title)
%li{:class=> active_nav_li(admin_conference_venue_info_path(@conference.short_title))}
= link_to "Venue", admin_conference_venue_info_path(@conference.short_title)
%li{:class=> active_nav_li(admin_conference_cfp_info_path(@conference.short_title))}
= link_to "Call for Papers", admin_conference_cfp_info_path(@conference.short_title)
%li{:class=> active_nav_li(admin_conference_rooms_list_path(@conference.short_title))}
= link_to "Rooms", admin_conference_rooms_list_path(@conference.short_title)
%li{:class=> active_nav_li(admin_conference_tracks_list_path(@conference.short_title))}
= link_to "Tracks", admin_conference_tracks_list_path(@conference.short_title)
%li{:class=> active_nav_li(admin_conference_eventtype_list_path(@conference.short_title))}
= link_to "Event Types", admin_conference_eventtype_list_path(@conference.short_title)
%li{:class=> active_nav_li(admin_conference_callforpapers_path(@conference.short_title))}
= link_to "Call for Papers", admin_conference_callforpapers_path(@conference.short_title)
%li{:class=> active_nav_li(admin_conference_rooms_path(@conference.short_title))}
= link_to "Rooms", admin_conference_rooms_path(@conference.short_title)
%li{:class=> active_nav_li(admin_conference_tracks_path(@conference.short_title))}
= link_to "Tracks", admin_conference_tracks_path(@conference.short_title)
%li{:class=> active_nav_li(admin_conference_eventtype_index_path(@conference.short_title))}
= link_to "Event Types", admin_conference_eventtype_index_path(@conference.short_title)
%li{:class=> active_nav_li(admin_conference_difficulty_levels_path(@conference.short_title))}
= link_to "Difficulty Levels", admin_conference_difficulty_levels_path(@conference.short_title)
%li{:class=> active_nav_li(admin_conference_social_events_path(@conference.short_title))}
= link_to "Social Events", admin_conference_social_events_path(@conference.short_title)
%li{:class=> active_nav_li(admin_conference_supporter_levels_path(@conference.short_title))}
= link_to "Supporter Levels", admin_conference_supporter_levels_path(@conference.short_title)
%li{:class=> active_nav_li(admin_conference_email_settings_path(@conference.short_title))}
= link_to "Emails", admin_conference_email_settings_path(@conference.short_title)
%li{:class=> active_nav_li(admin_conference_emails_path(@conference.short_title))}
= link_to "Emails", admin_conference_emails_path(@conference.short_title)
%li{:class=> active_nav_li(admin_conference_questions_path(@conference.short_title))}
= link_to "Questions", admin_conference_questions_path(@conference.short_title)
%li{:class=> active_nav_li(admin_conference_volunteers_info_path(@conference.short_title))}

View file

@ -2,7 +2,7 @@
.col-md-3
= render 'admin/conference/sidebar'
.col-md-9
= semantic_form_for(@conference, :url => admin_conference_difficulty_levels_path(@conference.short_title)) do |f|
= semantic_form_for @conference, :url => admin_conference_difficulty_level_path(@conference.short_title, @conference.difficulty_levels) do |f|
= f.input :use_difficulty_levels, :label => false
= dynamic_association :difficulty_levels, "Difficulty_Levels", f
= f.action :submit, :as => :button, :button_html => {:class => "btn btn-primary"}

View file

@ -24,7 +24,7 @@
%tr
%td {eventtitle}
%td The title of an accepted or rejected proposal
= semantic_form_for(@settings, :url => admin_conference_email_settings_path(@conference.short_title),:html => {:multipart => true}) do |f|
= semantic_form_for(@settings, :url => admin_conference_email_path(@conference.short_title, @conference.email_settings),:html => {:multipart => true}) do |f|
= f.input :send_on_registration, :label => false, :hint => "Send an email when the user registers for the conference?"
= f.input :registration_subject
= f.input :registration_email_template, :input_html => { :rows => 10, :cols => 20}

View file

@ -2,6 +2,6 @@
.col-md-3
= render 'admin/conference/sidebar'
.col-md-9
= semantic_form_for(@conference, :url => admin_conference_eventtype_update_path(@conference.short_title)) do |f|
= semantic_form_for(@conference, :url => admin_conference_eventtype_path(@conference.short_title, @conference.event_types)) do |f|
= dynamic_association :event_types, "Event Types", f
= f.action :submit, :as => :button, :button_html => {:class => "btn btn-primary"}

View file

@ -2,6 +2,6 @@
.col-md-3
= render 'admin/conference/sidebar'
.col-md-9
= semantic_form_for(@conference, :url => admin_conference_rooms_update_path(@conference.short_title)) do |f|
= semantic_form_for(@conference, :url => admin_conference_room_path(@conference.short_title, @conference.rooms)) do |f|
= dynamic_association :rooms, "Rooms", f
= f.action :submit, :as => :button, :button_html => {:class => "btn btn-primary"}

View file

@ -2,6 +2,6 @@
.col-md-3
= render 'admin/conference/sidebar'
.col-md-9
= semantic_form_for(@conference, :url => admin_conference_social_events_path(@conference.short_title)) do |f|
= semantic_form_for(@conference, :url => admin_conference_social_event_path(@conference.short_title, @conference.social_events)) do |f|
= dynamic_association :social_events, "Social Events", f
= f.action :submit, :as => :button, :button_html => {:class => "btn btn-primary"}

View file

@ -2,7 +2,7 @@
.col-md-3
= render 'admin/conference/sidebar'
.col-md-9
= semantic_form_for(@conference, :url => admin_conference_supporter_levels_path(@conference.short_title)) do |f|
= semantic_form_for(@conference, :url => admin_conference_supporter_level_path(@conference.short_title, @conference.supporter_levels)) do |f|
= f.input :use_supporter_levels, :label => false
= dynamic_association :supporter_levels, "Supporter Levels", f
= f.action :submit, :as => :button, :button_html => {:class => "btn btn-primary"}

View file

@ -2,6 +2,6 @@
.col-md-3
= render 'admin/conference/sidebar'
.col-md-9
= semantic_form_for(@conference, :url => admin_conference_tracks_update_path(@conference.short_title)) do |f|
= semantic_form_for(@conference, :url => admin_conference_track_path(@conference.short_title, @conference.tracks)) do |f|
= dynamic_association :tracks, "Tracks", f
= f.action :submit, :as => :button, :button_html => {:class => "btn btn-primary"}

View file

@ -16,30 +16,22 @@ Osem::Application.routes.draw do
put "/registrations/edit" => "registrations#update"
delete "/registrations" => "registrations#delete"
put "/registrations/change_field" => "registrations#change_field"
get "/emailsettings" => "emails#show", :as => "email_settings"
put "/emailsettings" => "emails#update"
get "/supporter_levels" => "supporter_levels#show"
put "/supporter_levels" => "supporter_levels#update"
get "/venue" => "venue#show", :as => "venue_info"
put "/venue" => "venue#update", :as => "venue_update"
get "/social_events" => "social_events#show", :as => "social_events"
put "/social_events" => "social_events#update"
get "/rooms" => "rooms#show", :as => "rooms_list"
put "/rooms" => "rooms#update", :as => "rooms_update"
get "/tracks" => "tracks#show", :as => "tracks_list"
put "/tracks" => "tracks#update", :as => "tracks_update"
get "/dietary_choices" => "dietchoices#show", :as => "dietary_list"
put "/dietary_choices" => "dietchoices#update", :as => "dietary_update"
get "/volunteers_list" => "volunteers#show"
get "/volunteers" => "volunteers#index", :as => "volunteers_info"
put "/volunteers" => "volunteers#update", :as => "volunteers_update"
get "/cfp" => "callforpapers#show", :as => "cfp_info"
put "/cfp" => "callforpapers#update", :as => "cfp_update"
post "/cfp" => "callforpapers#create", :as => "cfp_create"
get "/event_types" => "eventtype#show", :as => "eventtype_list"
put "/event_types" => "eventtype#update", :as => "eventtype_update"
put "/difficulty_levels" => "difficulty_levels#update"
resources :difficulty_levels
resources :difficulty_levels, only: [:show, :update, :index]
resources :rooms, only: [:show, :update, :index]
resources :tracks, only: [:show, :update, :index]
resources :eventtype, only: [:show, :update, :index]
resources :social_events, only: [:show, :update, :index]
resources :supporter_levels, only: [:show, :update, :index]
resources :emails, only: [:show, :update, :index]
resources :callforpapers, only: [:show, :update, :index]
put "/questions/update_conference" => "questions#update_conference"
resources :questions
resources :events do