diff --git a/app/controllers/admin/project_types_controller.rb b/app/controllers/admin/project_types_controller.rb index 8fbde4b..75a8d77 100644 --- a/app/controllers/admin/project_types_controller.rb +++ b/app/controllers/admin/project_types_controller.rb @@ -1,4 +1,6 @@ -class Admin::ProjectTypesController < OrbitAdminController +class Admin::ProjectTypesController < OrbitMemberController + before_action :allow_admin_only + def new @project_type = ProjectType.new @url = admin_project_types_path(@project_type) diff --git a/app/controllers/admin/projects_controller.rb b/app/controllers/admin/projects_controller.rb index e1206f7..725932a 100644 --- a/app/controllers/admin/projects_controller.rb +++ b/app/controllers/admin/projects_controller.rb @@ -4,6 +4,9 @@ class Admin::ProjectsController < 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 @projects = Project.order_by(:period_start_date=>'desc',:year=>'desc').page(params[:page]).per(10) end @@ -17,7 +20,7 @@ class Admin::ProjectsController < OrbitMemberController @member = MemberProfile.find(project_params['member_profile_id']) rescue nil @project = Project.new(project_params) @project.save - redirect_to '/admin/members/'+@member.to_param+'/Project' + redirect_to params['referer_url'] end def edit @@ -30,7 +33,7 @@ class Admin::ProjectsController < OrbitMemberController @project = Project.find(params[:id]) @project.update_attributes(project_params) @project.save - redirect_to '/admin/members/'+@member.to_param+'/Project' + redirect_to params['referer_url'] end def destroy @@ -66,7 +69,7 @@ class Admin::ProjectsController < OrbitMemberController @intro = @intro.nil? ? ProjectIntro.new({:member_profile_id=>@member.id}) : @intro @intro.update_attributes(intro_params) @intro.save - redirect_to '/admin/members/'+@member.to_param+'/Project' + redirect_to URI.encode('/admin/members/'+@member.to_param+'/Project') end def get_settings diff --git a/app/views/admin/projects/_form.html.erb b/app/views/admin/projects/_form.html.erb index 276ee34..445e537 100644 --- a/app/views/admin/projects/_form.html.erb +++ b/app/views/admin/projects/_form.html.erb @@ -231,6 +231,7 @@
<% end -%> | <%= t('personal_project.year') %> | @@ -37,7 +36,7 @@
---|---|
<%= check_box_tag 'to_change[]', project.id.to_s, false, :class => "list-check" %> | @@ -47,8 +46,10 @@ <%= link_to project.project_title, OrbitHelper.url_to_plugin_show(project.to_param,'personal_project').to_s, target: "blank"%>