From fc11653f2742c712762cff61468b76ebac2a67d3 Mon Sep 17 00:00:00 2001 From: Chrisbr Date: Mon, 28 Apr 2014 19:40:07 +0200 Subject: [PATCH 01/10] Fixes difficulty level form --- app/views/admin/difficulty_levels/index.html.haml | 2 +- config/routes.rb | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/views/admin/difficulty_levels/index.html.haml b/app/views/admin/difficulty_levels/index.html.haml index 2da43293..8f8e3d29 100644 --- a/app/views/admin/difficulty_levels/index.html.haml +++ b/app/views/admin/difficulty_levels/index.html.haml @@ -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_id => @conference.short_title, :id => @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"} diff --git a/config/routes.rb b/config/routes.rb index ccc0a49b..6c296a69 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -38,8 +38,8 @@ Osem::Application.routes.draw do 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 + #put "/difficulty_levels" => "difficulty_levels#update" + resources :difficulty_levels, :only => [ :show, :update, :index ] put "/questions/update_conference" => "questions#update_conference" resources :questions resources :events do From c4fbf8d038ec8bdefbbbb5a4ff116a01ae135192 Mon Sep 17 00:00:00 2001 From: Chrisbr Date: Mon, 28 Apr 2014 19:58:49 +0200 Subject: [PATCH 02/10] Fixes rooms form --- app/controllers/admin/rooms_controller.rb | 4 ++-- app/views/admin/conference/_sidebar.html.haml | 4 ++-- .../admin/rooms/{rooms_list.html.haml => index.html.haml} | 2 +- config/routes.rb | 5 ++--- 4 files changed, 7 insertions(+), 8 deletions(-) rename app/views/admin/rooms/{rooms_list.html.haml => index.html.haml} (75%) diff --git a/app/controllers/admin/rooms_controller.rb b/app/controllers/admin/rooms_controller.rb index fb72df5f..7d05b04b 100644 --- a/app/controllers/admin/rooms_controller.rb +++ b/app/controllers/admin/rooms_controller.rb @@ -7,9 +7,9 @@ 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 diff --git a/app/views/admin/conference/_sidebar.html.haml b/app/views/admin/conference/_sidebar.html.haml index 55797542..196279cb 100644 --- a/app/views/admin/conference/_sidebar.html.haml +++ b/app/views/admin/conference/_sidebar.html.haml @@ -6,8 +6,8 @@ = 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_rooms_path(@conference.short_title))} + = link_to "Rooms", admin_conference_rooms_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))} diff --git a/app/views/admin/rooms/rooms_list.html.haml b/app/views/admin/rooms/index.html.haml similarity index 75% rename from app/views/admin/rooms/rooms_list.html.haml rename to app/views/admin/rooms/index.html.haml index 0410f33c..7f8c9268 100644 --- a/app/views/admin/rooms/rooms_list.html.haml +++ b/app/views/admin/rooms/index.html.haml @@ -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(:conferecene_id => @conference.short_title, :id => @conference.rooms)) do |f| = dynamic_association :rooms, "Rooms", f = f.action :submit, :as => :button, :button_html => {:class => "btn btn-primary"} diff --git a/config/routes.rb b/config/routes.rb index 6c296a69..9174d5a2 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -24,8 +24,6 @@ Osem::Application.routes.draw do 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" @@ -38,8 +36,9 @@ Osem::Application.routes.draw do 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, :only => [ :show, :update, :index ] + resources :rooms, :only => [ :show, :update, :index ] put "/questions/update_conference" => "questions#update_conference" resources :questions resources :events do From c67b255e050d05a16d634a977529f57c6e0b4c47 Mon Sep 17 00:00:00 2001 From: Chrisbr Date: Mon, 28 Apr 2014 20:01:20 +0200 Subject: [PATCH 03/10] Fixes tracks form --- app/controllers/admin/tracks_controller.rb | 4 ++-- app/views/admin/conference/_sidebar.html.haml | 4 ++-- .../admin/tracks/{tracks_list.html.haml => index.html.haml} | 2 +- config/routes.rb | 3 +-- 4 files changed, 6 insertions(+), 7 deletions(-) rename app/views/admin/tracks/{tracks_list.html.haml => index.html.haml} (75%) diff --git a/app/controllers/admin/tracks_controller.rb b/app/controllers/admin/tracks_controller.rb index c7126bdd..ea58759b 100644 --- a/app/controllers/admin/tracks_controller.rb +++ b/app/controllers/admin/tracks_controller.rb @@ -10,9 +10,9 @@ class Admin::TracksController < ApplicationController 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 diff --git a/app/views/admin/conference/_sidebar.html.haml b/app/views/admin/conference/_sidebar.html.haml index 196279cb..2e80d4c1 100644 --- a/app/views/admin/conference/_sidebar.html.haml +++ b/app/views/admin/conference/_sidebar.html.haml @@ -8,8 +8,8 @@ = link_to "Call for Papers", admin_conference_cfp_info_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_list_path(@conference.short_title))} - = link_to "Tracks", admin_conference_tracks_list_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_list_path(@conference.short_title))} = link_to "Event Types", admin_conference_eventtype_list_path(@conference.short_title) %li{:class=> active_nav_li(admin_conference_difficulty_levels_path(@conference.short_title))} diff --git a/app/views/admin/tracks/tracks_list.html.haml b/app/views/admin/tracks/index.html.haml similarity index 75% rename from app/views/admin/tracks/tracks_list.html.haml rename to app/views/admin/tracks/index.html.haml index edb3485f..0dd93ea1 100644 --- a/app/views/admin/tracks/tracks_list.html.haml +++ b/app/views/admin/tracks/index.html.haml @@ -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_id => @conference.short_title, :id => @conference.tracks)) do |f| = dynamic_association :tracks, "Tracks", f = f.action :submit, :as => :button, :button_html => {:class => "btn btn-primary"} diff --git a/config/routes.rb b/config/routes.rb index 9174d5a2..f695e02a 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -24,8 +24,6 @@ Osem::Application.routes.draw do put "/venue" => "venue#update", :as => "venue_update" get "/social_events" => "social_events#show", :as => "social_events" put "/social_events" => "social_events#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" @@ -39,6 +37,7 @@ Osem::Application.routes.draw do resources :difficulty_levels, :only => [ :show, :update, :index ] resources :rooms, :only => [ :show, :update, :index ] + resources :tracks, :only => [ :show, :update, :index ] put "/questions/update_conference" => "questions#update_conference" resources :questions resources :events do From 229581efc39dea05145e2b4773a6cba7bed16b00 Mon Sep 17 00:00:00 2001 From: Chrisbr Date: Mon, 28 Apr 2014 20:08:06 +0200 Subject: [PATCH 04/10] Fixes eventtype form --- app/controllers/admin/eventtype_controller.rb | 4 ++-- app/views/admin/conference/_sidebar.html.haml | 4 ++-- app/views/admin/eventtype/event_type_list.html.haml | 2 +- config/routes.rb | 3 +-- 4 files changed, 6 insertions(+), 7 deletions(-) diff --git a/app/controllers/admin/eventtype_controller.rb b/app/controllers/admin/eventtype_controller.rb index 04d8f2e0..a335c8f2 100644 --- a/app/controllers/admin/eventtype_controller.rb +++ b/app/controllers/admin/eventtype_controller.rb @@ -8,9 +8,9 @@ class Admin::EventtypeController < ApplicationController 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.') + 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_list_path(:conference_id => @conference.short_title), :alert => 'Event types update failed: #{e.message}') + redirect_to(admin_conference_eventtype_path(:conference_id => @conference.short_title), :alert => 'Event types update failed: #{e.message}') end end end \ No newline at end of file diff --git a/app/views/admin/conference/_sidebar.html.haml b/app/views/admin/conference/_sidebar.html.haml index 2e80d4c1..294c42a6 100644 --- a/app/views/admin/conference/_sidebar.html.haml +++ b/app/views/admin/conference/_sidebar.html.haml @@ -10,8 +10,8 @@ = 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_list_path(@conference.short_title))} - = link_to "Event Types", admin_conference_eventtype_list_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))} diff --git a/app/views/admin/eventtype/event_type_list.html.haml b/app/views/admin/eventtype/event_type_list.html.haml index 637b7c99..d1eefa53 100644 --- a/app/views/admin/eventtype/event_type_list.html.haml +++ b/app/views/admin/eventtype/event_type_list.html.haml @@ -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_id => @conference.short_title, :id => @conference.event_types)) do |f| = dynamic_association :event_types, "Event Types", f = f.action :submit, :as => :button, :button_html => {:class => "btn btn-primary"} diff --git a/config/routes.rb b/config/routes.rb index f695e02a..471628b9 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -32,12 +32,11 @@ Osem::Application.routes.draw do 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" 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 ] put "/questions/update_conference" => "questions#update_conference" resources :questions resources :events do From e432b71fb785f0b41662dfea105d0db123782ab6 Mon Sep 17 00:00:00 2001 From: Chrisbr Date: Mon, 28 Apr 2014 20:14:43 +0200 Subject: [PATCH 05/10] Fixes social_events form --- .../{social_events_list.html.haml => index.html.haml} | 2 +- config/routes.rb | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) rename app/views/admin/social_events/{social_events_list.html.haml => index.html.haml} (73%) diff --git a/app/views/admin/social_events/social_events_list.html.haml b/app/views/admin/social_events/index.html.haml similarity index 73% rename from app/views/admin/social_events/social_events_list.html.haml rename to app/views/admin/social_events/index.html.haml index 579abd55..0952ffa9 100644 --- a/app/views/admin/social_events/social_events_list.html.haml +++ b/app/views/admin/social_events/index.html.haml @@ -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_id => @conference.short_title, :id => @conference.social_events)) do |f| = dynamic_association :social_events, "Social Events", f = f.action :submit, :as => :button, :button_html => {:class => "btn btn-primary"} diff --git a/config/routes.rb b/config/routes.rb index 471628b9..bed913b7 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -22,8 +22,6 @@ Osem::Application.routes.draw do 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 "/dietary_choices" => "dietchoices#show", :as => "dietary_list" put "/dietary_choices" => "dietchoices#update", :as => "dietary_update" get "/volunteers_list" => "volunteers#show" @@ -37,6 +35,7 @@ Osem::Application.routes.draw do 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 ] put "/questions/update_conference" => "questions#update_conference" resources :questions resources :events do From 4b401c4cea922b4532bfb9439329952e1a25e19f Mon Sep 17 00:00:00 2001 From: Chrisbr Date: Mon, 28 Apr 2014 20:19:10 +0200 Subject: [PATCH 06/10] Fixes supporter level form --- .../{supporter_levels.html.haml => index.html.haml} | 2 +- config/routes.rb | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) rename app/views/admin/supporter_levels/{supporter_levels.html.haml => index.html.haml} (80%) diff --git a/app/views/admin/supporter_levels/supporter_levels.html.haml b/app/views/admin/supporter_levels/index.html.haml similarity index 80% rename from app/views/admin/supporter_levels/supporter_levels.html.haml rename to app/views/admin/supporter_levels/index.html.haml index e45f0e4b..fa809dbc 100644 --- a/app/views/admin/supporter_levels/supporter_levels.html.haml +++ b/app/views/admin/supporter_levels/index.html.haml @@ -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"} diff --git a/config/routes.rb b/config/routes.rb index bed913b7..16b34704 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -18,8 +18,6 @@ Osem::Application.routes.draw do 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 "/dietary_choices" => "dietchoices#show", :as => "dietary_list" @@ -36,6 +34,7 @@ Osem::Application.routes.draw do 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 ] put "/questions/update_conference" => "questions#update_conference" resources :questions resources :events do From 810908089e3b7bde1bd2ea50b91961a02c67bd06 Mon Sep 17 00:00:00 2001 From: Chrisbr Date: Mon, 28 Apr 2014 20:25:43 +0200 Subject: [PATCH 07/10] Refactoring: Removes not necessary named parameters --- app/controllers/admin/eventtype_controller.rb | 2 +- app/views/admin/difficulty_levels/index.html.haml | 2 +- app/views/admin/eventtype/event_type_list.html.haml | 2 +- app/views/admin/rooms/index.html.haml | 2 +- app/views/admin/social_events/index.html.haml | 2 +- app/views/admin/tracks/index.html.haml | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/app/controllers/admin/eventtype_controller.rb b/app/controllers/admin/eventtype_controller.rb index a335c8f2..349a0408 100644 --- a/app/controllers/admin/eventtype_controller.rb +++ b/app/controllers/admin/eventtype_controller.rb @@ -2,7 +2,7 @@ class Admin::EventtypeController < ApplicationController before_filter :verify_organizer def show - render :event_type_list + render :eventtype_list end def update diff --git a/app/views/admin/difficulty_levels/index.html.haml b/app/views/admin/difficulty_levels/index.html.haml index 8f8e3d29..124c47bd 100644 --- a/app/views/admin/difficulty_levels/index.html.haml +++ b/app/views/admin/difficulty_levels/index.html.haml @@ -2,7 +2,7 @@ .col-md-3 = render 'admin/conference/sidebar' .col-md-9 - = semantic_form_for @conference, :url => admin_conference_difficulty_level_path(:conference_id => @conference.short_title, :id => @conference.difficulty_levels) 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"} diff --git a/app/views/admin/eventtype/event_type_list.html.haml b/app/views/admin/eventtype/event_type_list.html.haml index d1eefa53..dfac0b33 100644 --- a/app/views/admin/eventtype/event_type_list.html.haml +++ b/app/views/admin/eventtype/event_type_list.html.haml @@ -2,6 +2,6 @@ .col-md-3 = render 'admin/conference/sidebar' .col-md-9 - = semantic_form_for(@conference, :url => admin_conference_eventtype_path(:conference_id => @conference.short_title, :id => @conference.event_types)) 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"} diff --git a/app/views/admin/rooms/index.html.haml b/app/views/admin/rooms/index.html.haml index 7f8c9268..e2021354 100644 --- a/app/views/admin/rooms/index.html.haml +++ b/app/views/admin/rooms/index.html.haml @@ -2,6 +2,6 @@ .col-md-3 = render 'admin/conference/sidebar' .col-md-9 - = semantic_form_for(@conference, :url => admin_conference_room_path(:conferecene_id => @conference.short_title, :id => @conference.rooms)) 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"} diff --git a/app/views/admin/social_events/index.html.haml b/app/views/admin/social_events/index.html.haml index 0952ffa9..c6cf1f1a 100644 --- a/app/views/admin/social_events/index.html.haml +++ b/app/views/admin/social_events/index.html.haml @@ -2,6 +2,6 @@ .col-md-3 = render 'admin/conference/sidebar' .col-md-9 - = semantic_form_for(@conference, :url => admin_conference_social_event_path(:conference_id => @conference.short_title, :id => @conference.social_events)) 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"} diff --git a/app/views/admin/tracks/index.html.haml b/app/views/admin/tracks/index.html.haml index 0dd93ea1..0076776a 100644 --- a/app/views/admin/tracks/index.html.haml +++ b/app/views/admin/tracks/index.html.haml @@ -2,6 +2,6 @@ .col-md-3 = render 'admin/conference/sidebar' .col-md-9 - = semantic_form_for(@conference, :url => admin_conference_track_path(:conference_id => @conference.short_title, :id => @conference.tracks)) 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"} From ba2051afc7d0f2b8caed0cd91d4fcaf2dc3a5a36 Mon Sep 17 00:00:00 2001 From: Chrisbr Date: Mon, 28 Apr 2014 20:31:44 +0200 Subject: [PATCH 08/10] Fixes email settings form --- app/controllers/admin/emails_controller.rb | 4 ++-- app/views/admin/conference/_sidebar.html.haml | 4 ++-- app/views/admin/emails/{show.html.haml => index.html.haml} | 2 +- config/routes.rb | 5 +++-- 4 files changed, 8 insertions(+), 7 deletions(-) rename app/views/admin/emails/{show.html.haml => index.html.haml} (95%) diff --git a/app/controllers/admin/emails_controller.rb b/app/controllers/admin/emails_controller.rb index fcdc0d6a..64b263f9 100644 --- a/app/controllers/admin/emails_controller.rb +++ b/app/controllers/admin/emails_controller.rb @@ -3,10 +3,10 @@ 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 diff --git a/app/views/admin/conference/_sidebar.html.haml b/app/views/admin/conference/_sidebar.html.haml index 294c42a6..6b14338b 100644 --- a/app/views/admin/conference/_sidebar.html.haml +++ b/app/views/admin/conference/_sidebar.html.haml @@ -18,8 +18,8 @@ = 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))} diff --git a/app/views/admin/emails/show.html.haml b/app/views/admin/emails/index.html.haml similarity index 95% rename from app/views/admin/emails/show.html.haml rename to app/views/admin/emails/index.html.haml index 1f65f7b9..77c170d4 100644 --- a/app/views/admin/emails/show.html.haml +++ b/app/views/admin/emails/index.html.haml @@ -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} diff --git a/config/routes.rb b/config/routes.rb index 16b34704..ce0aed46 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -16,8 +16,8 @@ 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 "/emailsettings" => "emails#show", :as => "email_settings" + #put "/emailsettings" => "emails#update" get "/venue" => "venue#show", :as => "venue_info" put "/venue" => "venue#update", :as => "venue_update" get "/dietary_choices" => "dietchoices#show", :as => "dietary_list" @@ -35,6 +35,7 @@ Osem::Application.routes.draw do 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 ] put "/questions/update_conference" => "questions#update_conference" resources :questions resources :events do From 169fab5c311700702bbd4e5d870ab597197b59cb Mon Sep 17 00:00:00 2001 From: Chrisbr Date: Mon, 28 Apr 2014 20:52:02 +0200 Subject: [PATCH 09/10] Fixes cfp form --- app/controllers/admin/callforpapers_controller.rb | 8 ++++---- .../callforpapers/{show.html.haml => index.html.haml} | 2 +- app/views/admin/conference/_sidebar.html.haml | 4 ++-- config/routes.rb | 6 +----- 4 files changed, 8 insertions(+), 12 deletions(-) rename app/views/admin/callforpapers/{show.html.haml => index.html.haml} (87%) diff --git a/app/controllers/admin/callforpapers_controller.rb b/app/controllers/admin/callforpapers_controller.rb index 910b273e..b36b548c 100644 --- a/app/controllers/admin/callforpapers_controller.rb +++ b/app/controllers/admin/callforpapers_controller.rb @@ -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,7 +11,7 @@ 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 @@ -19,9 +19,9 @@ class Admin::CallforpapersController < ApplicationController @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 diff --git a/app/views/admin/callforpapers/show.html.haml b/app/views/admin/callforpapers/index.html.haml similarity index 87% rename from app/views/admin/callforpapers/show.html.haml rename to app/views/admin/callforpapers/index.html.haml index 7f879e54..79ce99dc 100644 --- a/app/views/admin/callforpapers/show.html.haml +++ b/app/views/admin/callforpapers/index.html.haml @@ -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" } diff --git a/app/views/admin/conference/_sidebar.html.haml b/app/views/admin/conference/_sidebar.html.haml index 6b14338b..c4e8b1e0 100644 --- a/app/views/admin/conference/_sidebar.html.haml +++ b/app/views/admin/conference/_sidebar.html.haml @@ -4,8 +4,8 @@ = 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_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))} diff --git a/config/routes.rb b/config/routes.rb index ce0aed46..7ab85652 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -16,8 +16,6 @@ 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 "/venue" => "venue#show", :as => "venue_info" put "/venue" => "venue#update", :as => "venue_update" get "/dietary_choices" => "dietchoices#show", :as => "dietary_list" @@ -25,9 +23,6 @@ Osem::Application.routes.draw do 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" resources :difficulty_levels, :only => [ :show, :update, :index ] resources :rooms, :only => [ :show, :update, :index ] @@ -36,6 +31,7 @@ Osem::Application.routes.draw do 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 From 8154e6f72cc776c40255611133ebadf66f0f0c9c Mon Sep 17 00:00:00 2001 From: Chrisbr Date: Mon, 28 Apr 2014 21:42:09 +0200 Subject: [PATCH 10/10] Fixes Hound CI violations --- .../admin/callforpapers_controller.rb | 15 ++++++++++----- app/controllers/admin/emails_controller.rb | 5 +++-- app/controllers/admin/eventtype_controller.rb | 16 +++++++++------- app/controllers/admin/rooms_controller.rb | 10 ++++++---- app/controllers/admin/tracks_controller.rb | 14 ++++++++------ config/routes.rb | 16 ++++++++-------- 6 files changed, 44 insertions(+), 32 deletions(-) diff --git a/app/controllers/admin/callforpapers_controller.rb b/app/controllers/admin/callforpapers_controller.rb index b36b548c..3d8f8768 100644 --- a/app/controllers/admin/callforpapers_controller.rb +++ b/app/controllers/admin/callforpapers_controller.rb @@ -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_callforpapers_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_callforpapers_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_callforpapers_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 diff --git a/app/controllers/admin/emails_controller.rb b/app/controllers/admin/emails_controller.rb index 64b263f9..dbdfc44d 100644 --- a/app/controllers/admin/emails_controller.rb +++ b/app/controllers/admin/emails_controller.rb @@ -3,11 +3,12 @@ class Admin::EmailsController < ApplicationController def update @conference.email_settings.update_attributes(params[:email_settings]) - redirect_to(admin_conference_emails_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 index @settings = @conference.email_settings end - end diff --git a/app/controllers/admin/eventtype_controller.rb b/app/controllers/admin/eventtype_controller.rb index 349a0408..125af325 100644 --- a/app/controllers/admin/eventtype_controller.rb +++ b/app/controllers/admin/eventtype_controller.rb @@ -6,11 +6,13 @@ class Admin::EventtypeController < ApplicationController end def update - begin - @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 + @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 \ No newline at end of file +end diff --git a/app/controllers/admin/rooms_controller.rb b/app/controllers/admin/rooms_controller.rb index 7d05b04b..00342258 100644 --- a/app/controllers/admin/rooms_controller.rb +++ b/app/controllers/admin/rooms_controller.rb @@ -7,11 +7,13 @@ class Admin::RoomsController < ApplicationController def update if @conference.update_attributes(params[:conference]) - redirect_to(admin_conference_rooms_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_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 diff --git a/app/controllers/admin/tracks_controller.rb b/app/controllers/admin/tracks_controller.rb index ea58759b..102cdd68 100644 --- a/app/controllers/admin/tracks_controller.rb +++ b/app/controllers/admin/tracks_controller.rb @@ -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_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_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 diff --git a/config/routes.rb b/config/routes.rb index 7ab85652..e437fe45 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -24,14 +24,14 @@ Osem::Application.routes.draw do get "/volunteers" => "volunteers#index", :as => "volunteers_info" put "/volunteers" => "volunteers#update", :as => "volunteers_update" - 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 ] + 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