diff --git a/app/controllers/admin/experience_types_controller.rb b/app/controllers/admin/experience_types_controller.rb index 3b3c5c9..d06e7fb 100644 --- a/app/controllers/admin/experience_types_controller.rb +++ b/app/controllers/admin/experience_types_controller.rb @@ -1,4 +1,6 @@ -class Admin::ExperienceTypesController < OrbitAdminController +class Admin::ExperienceTypesController < OrbitMemberController + before_action :allow_admin_only + def new @experience_type = ExperienceType.new @url = admin_experience_types_path(@experience_type) diff --git a/app/controllers/admin/experiences_controller.rb b/app/controllers/admin/experiences_controller.rb index 1c70e29..ca0c711 100644 --- a/app/controllers/admin/experiences_controller.rb +++ b/app/controllers/admin/experiences_controller.rb @@ -4,6 +4,9 @@ class Admin::ExperiencesController < OrbitMemberController before_action :set_plugin before_action :get_settings,:only => [:new, :edit, :setting] + before_action :need_access_right + before_action :allow_admin_only, :only => [:index, :setting] + def index @experiences = Experience.order_by(:end_date=>'desc',:start_date=>'desc').page(params[:page]).per(10) end @@ -17,7 +20,7 @@ class Admin::ExperiencesController < OrbitMemberController @member = MemberProfile.find(experience_params['member_profile_id']) rescue nil @experience = Experience.new(experience_params) @experience.save - redirect_to URI.encode('/admin/members/'+@member.to_param+'/Experience') + redirect_to params['referer_url'] end def edit @@ -30,7 +33,7 @@ class Admin::ExperiencesController < OrbitMemberController @experience = Experience.find(params[:id]) @experience.update_attributes(experience_params) @experience.save - redirect_to URI.encode('/admin/members/'+@member.to_param+'/Experience') + redirect_to params['referer_url'] end def destroy diff --git a/app/views/admin/experiences/_form.html.erb b/app/views/admin/experiences/_form.html.erb index 78722d1..99f792f 100644 --- a/app/views/admin/experiences/_form.html.erb +++ b/app/views/admin/experiences/_form.html.erb @@ -173,6 +173,7 @@
<% end -%> | <%= t('date_') %> | @@ -38,7 +37,7 @@
---|---|
<%= check_box_tag 'to_change[]', experience.id.to_s, false, :class => "list-check" %> | @@ -48,8 +47,10 @@ <%= link_to experience.organizationt_title, OrbitHelper.url_to_plugin_show(experience.to_param,'personal_experience'), target: "blank"%>