From 75fecc040274d7543b4e8bb5549fa930177720dc Mon Sep 17 00:00:00 2001 From: huang Date: Fri, 11 Dec 2015 12:53:01 +0800 Subject: [PATCH] =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E5=88=A0=E9=99=A4=E5=8A=9F?= =?UTF-8?q?=E8=83=BD=20=E9=A1=B9=E7=9B=AE=E5=88=A0=E9=99=A4=E6=9D=83?= =?UTF-8?q?=E9=99=90=20=E8=AF=BE=E7=A8=8B=E5=88=97=E8=A1=A8=E7=94=A8?= =?UTF-8?q?=E6=88=B7=E9=A2=9C=E8=89=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/projects_controller.rb | 6 +++++- app/views/courses/_member.html.erb | 2 +- app/views/projects/settings/_new_edit.html.erb | 9 +++++++++ config/locales/zh.yml | 1 + 4 files changed, 16 insertions(+), 2 deletions(-) diff --git a/app/controllers/projects_controller.rb b/app/controllers/projects_controller.rb index 200bd4d69..88aae0f8b 100644 --- a/app/controllers/projects_controller.rb +++ b/app/controllers/projects_controller.rb @@ -697,7 +697,11 @@ class ProjectsController < ApplicationController flash[:error] = l(:error_can_not_archive_project) end end - redirect_to admin_projects_url(:status => params[:status]) + if params[:type] == "project" + redirect_to user_path(User.current) + else + redirect_to admin_projects_url(:status => params[:status]) + end end def unarchive diff --git a/app/views/courses/_member.html.erb b/app/views/courses/_member.html.erb index 7762a0798..1bfe3cbd7 100644 --- a/app/views/courses/_member.html.erb +++ b/app/views/courses/_member.html.erb @@ -1,7 +1,7 @@ <% @members.each do |member| %>
  • <%#= link_to_user_header member.principal,true,:class => "w150 c_orange fl" %> - <%= link_to "#{member.principal}(#{member.principal.show_name})", user_path(member.principal), :class => "w150 c_orange fl" %> + <%= link_to "#{member.principal}(#{member.principal.show_name})", user_path(member.principal), :class => "w150 linkBlue fl" %> <%= zh_course_role(h member.roles.sort.collect(&:to_s).join(', ')) %> <%= form_for(member, {:as => :membership, :remote => true, :url => membership_path(member), diff --git a/app/views/projects/settings/_new_edit.html.erb b/app/views/projects/settings/_new_edit.html.erb index b38871a60..1d204a52b 100644 --- a/app/views/projects/settings/_new_edit.html.erb +++ b/app/views/projects/settings/_new_edit.html.erb @@ -26,4 +26,13 @@ 保存 <% end %> +<% if User.current.member_of?(@project) && Member.where(:user_id => User.current.id, :project_id => @project.id).first.roles.to_s.include?("Manager") %> +
    + + <%= link_to(l(:button_delete_project), { :controller => 'projects', :action => 'archive', :id => @project, :status => params[:status], :type =>"project" }, + :data => {:confirm => l(:text_are_you_sure)}, :method => :post) unless @project.archived? %> + <%#=link_to "删除该课程", course_path(@course), :method => :delete, :confirm=>"确认要删除该课程吗?" %> + (友情提示:删除该项目后如果您想恢复该项目,请联系系统管理员!) +
    +<% end %>
    diff --git a/config/locales/zh.yml b/config/locales/zh.yml index 7ccbb8410..81b20a67e 100644 --- a/config/locales/zh.yml +++ b/config/locales/zh.yml @@ -921,6 +921,7 @@ zh: button_rollback: 恢复到这个版本 button_reply: 回复 button_archive: 存档 + button_delete_project: 删除项目 button_unarchive: 取消存档 button_reset: 重置 button_rename: 重命名/重定向