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: 重命名/重定向