diff --git a/app/controllers/admin/conference_author_types_controller.rb b/app/controllers/admin/conference_author_types_controller.rb index 12cd592..6b09399 100644 --- a/app/controllers/admin/conference_author_types_controller.rb +++ b/app/controllers/admin/conference_author_types_controller.rb @@ -1,4 +1,6 @@ -class Admin::ConferenceAuthorTypesController < OrbitAdminController +class Admin::ConferenceAuthorTypesController < OrbitMemberController + before_action :allow_admin_only + def new @author_type = ConferenceAuthorType.new @url = admin_conference_author_types_path(@author_type) diff --git a/app/controllers/admin/conference_paper_levels_controller.rb b/app/controllers/admin/conference_paper_levels_controller.rb index acd4551..f3464aa 100644 --- a/app/controllers/admin/conference_paper_levels_controller.rb +++ b/app/controllers/admin/conference_paper_levels_controller.rb @@ -1,4 +1,6 @@ -class Admin::ConferencePaperLevelsController < OrbitAdminController +class Admin::ConferencePaperLevelsController < OrbitMemberController + before_action :allow_admin_only + def new @paper_level = ConferencePaperLevel.new @url = admin_conference_paper_levels_path(@paper_level) diff --git a/app/controllers/admin/conference_paper_types_controller.rb b/app/controllers/admin/conference_paper_types_controller.rb index 0d34e2c..f598e10 100644 --- a/app/controllers/admin/conference_paper_types_controller.rb +++ b/app/controllers/admin/conference_paper_types_controller.rb @@ -1,4 +1,6 @@ -class Admin::ConferencePaperTypesController < OrbitAdminController +class Admin::ConferencePaperTypesController < OrbitMemberController + before_action :allow_admin_only + def new @paper_type = ConferencePaperType.new @url = admin_conference_paper_types_path(@paper_type) diff --git a/app/controllers/admin/writing_conferences_controller.rb b/app/controllers/admin/writing_conferences_controller.rb index b6564fa..d9d05d5 100644 --- a/app/controllers/admin/writing_conferences_controller.rb +++ b/app/controllers/admin/writing_conferences_controller.rb @@ -4,6 +4,9 @@ class Admin::WritingConferencesController < OrbitMemberController before_action :set_plugin before_action :get_settings,:only => [:new, :edit, :setting] + before_action :allow_admin_only, :only => [:setting] + before_action :need_access_right,:only => [ :new, :create, :edit, :update, :destroy, :frontend_setting, :update_frontend_setting] + def index @writing_conferences = WritingConference.order_by(:year=>'desc').page(params[:page]).per(10) end @@ -17,7 +20,7 @@ class Admin::WritingConferencesController < OrbitMemberController @member = MemberProfile.find(conference_params['member_profile_id']) rescue nil @writing_conference = WritingConference.new(conference_params) @writing_conference.save - redirect_to URI.encode('/admin/members/'+@member.to_param+'/WritingConference') + redirect_to params['referer_url'] end def edit @@ -30,7 +33,7 @@ class Admin::WritingConferencesController < OrbitMemberController @writing_conference = WritingConference.find(params[:id]) @writing_conference.update_attributes(conference_params) @writing_conference.save - redirect_to URI.encode('/admin/members/'+@member.to_param+'/WritingConference') + redirect_to params['referer_url'] end def destroy diff --git a/app/views/admin/writing_conferences/_form.html.erb b/app/views/admin/writing_conferences/_form.html.erb index 3ed9fba..23be3c4 100644 --- a/app/views/admin/writing_conferences/_form.html.erb +++ b/app/views/admin/writing_conferences/_form.html.erb @@ -300,6 +300,7 @@
<% end -%> | <%= t('personal_plugins.year') %> | @@ -39,7 +38,7 @@
---|---|
<%= check_box_tag 'to_change[]', writing_conference.id.to_s, false, :class => "list-check" %> | @@ -49,8 +48,10 @@ <%= link_to writing_conference.paper_title, OrbitHelper.url_to_plugin_show(writing_conference.to_param,'personal_conference'), target: "blank"%>