fix event type naming
This commit is contained in:
parent
748b33e7c2
commit
fd7f213178
6 changed files with 26 additions and 5 deletions
21
app/controllers/admin/event_types_controller.rb
Normal file
21
app/controllers/admin/event_types_controller.rb
Normal file
|
|
@ -0,0 +1,21 @@
|
||||||
|
module Admin
|
||||||
|
class EventTypesController < Admin::BaseController
|
||||||
|
authorize_resource
|
||||||
|
load_and_authorize_resource :conference, find_by: :short_title
|
||||||
|
|
||||||
|
def show
|
||||||
|
render :eventtypes
|
||||||
|
end
|
||||||
|
|
||||||
|
def update
|
||||||
|
@conference.update_attributes!(params[:conference])
|
||||||
|
redirect_to(admin_conference_event_types_path(
|
||||||
|
conference_id: @conference.short_title),
|
||||||
|
notice: 'Event types were successfully updated.')
|
||||||
|
rescue Exception => e
|
||||||
|
redirect_to(admin_conference_event_types_path(
|
||||||
|
conference_id: @conference.short_title),
|
||||||
|
alert: "Event types update failed: #{e.message}")
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
@ -23,7 +23,7 @@
|
||||||
= link_to 'Add tracks', admin_conference_tracks_path(conference_progress['short_title'])
|
= link_to 'Add tracks', admin_conference_tracks_path(conference_progress['short_title'])
|
||||||
%li{'class'=>class_for_todo(conference_progress['event_types'])}
|
%li{'class'=>class_for_todo(conference_progress['event_types'])}
|
||||||
%span{'class'=>icon_for_todo(conference_progress['event_types'])}
|
%span{'class'=>icon_for_todo(conference_progress['event_types'])}
|
||||||
= link_to 'Add event types', admin_conference_eventtypes_path(conference_progress['short_title'])
|
= link_to 'Add event types', admin_conference_event_types_path(conference_progress['short_title'])
|
||||||
%li{'class'=>class_for_todo(conference_progress['difficulty_levels'])}
|
%li{'class'=>class_for_todo(conference_progress['difficulty_levels'])}
|
||||||
%span{'class'=>icon_for_todo(conference_progress['difficulty_levels'])}
|
%span{'class'=>icon_for_todo(conference_progress['difficulty_levels'])}
|
||||||
= link_to 'Add difficulty levels', admin_conference_difficulty_levels_path(conference_progress['short_title'])
|
= link_to 'Add difficulty levels', admin_conference_difficulty_levels_path(conference_progress['short_title'])
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
.row
|
.row
|
||||||
.col-md-8
|
.col-md-8
|
||||||
= semantic_form_for(@conference, url: admin_conference_eventtypes_path(@conference.short_title, @conference.event_types)) do |f|
|
= semantic_form_for(@conference, url: admin_conference_event_types_path(@conference.short_title, @conference.event_types)) do |f|
|
||||||
= dynamic_association :event_types, "Event Types", f
|
= dynamic_association :event_types, "Event Types", f
|
||||||
= f.action :submit, :as => :button, :button_html => {:class => "btn btn-primary"}
|
= f.action :submit, :as => :button, :button_html => {:class => "btn btn-primary"}
|
||||||
|
|
@ -83,8 +83,8 @@
|
||||||
%ul.nav.nav-stacked.nav-pills.small.collapse.subNav
|
%ul.nav.nav-stacked.nav-pills.small.collapse.subNav
|
||||||
%li{:class=> active_nav_li(admin_conference_tracks_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)
|
= link_to 'Tracks', admin_conference_tracks_path(@conference.short_title)
|
||||||
%li{:class=> active_nav_li(admin_conference_eventtypes_path(@conference.short_title))}
|
%li{:class=> active_nav_li(admin_conference_event_types_path(@conference.short_title))}
|
||||||
= link_to 'Event types', admin_conference_eventtypes_path(@conference.short_title)
|
= link_to 'Event types', admin_conference_event_types_path(@conference.short_title)
|
||||||
%li{:class=> active_nav_li(admin_conference_difficulty_levels_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)
|
= link_to 'Difficulty levels', admin_conference_difficulty_levels_path(@conference.short_title)
|
||||||
%li{:class=> active_nav_li(admin_conference_questions_path(@conference.short_title))}
|
%li{:class=> active_nav_li(admin_conference_questions_path(@conference.short_title))}
|
||||||
|
|
|
||||||
|
|
@ -37,7 +37,7 @@ Osem::Application.routes.draw do
|
||||||
|
|
||||||
resources :campaigns
|
resources :campaigns
|
||||||
|
|
||||||
resources :eventtypes, only: [:show, :index] do
|
resources :event_types, only: [:show, :index] do
|
||||||
collection do
|
collection do
|
||||||
patch :update
|
patch :update
|
||||||
end
|
end
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue