Allow admin to copy, archive and delete project from project overview

This commit is contained in:
Alexander Meindl 2020-01-19 08:41:55 +01:00
parent 9023009454
commit aed85b0065
3 changed files with 19 additions and 0 deletions

View File

@ -3,3 +3,10 @@ Deface::Override.new virtual_path: 'projects/show',
insert_after: "div.#{Redmine::VERSION.to_s >= '4.1' ? 'splitcontent' : 'splitcontentright'}",
original: '8cd4d1b38e8afcb4665dbfea661b7048fbd92cf7',
text: '<%= call_hook(:view_projects_show_bottom, project: @project) %>'
if Redmine::VERSION.to_s >= '4.1'
Deface::Override.new virtual_path: 'projects/show',
name: 'view-projects-actions-dropdown-hook',
insert_before: 'erb[loud]:contains("link_to_if_authorized l(:label_settings)")',
original: 'da5a3461fab48e7198701c3e7e5a8e98295d9e3a',
text: '<%= call_hook(:view_projects_show_actions_dropdown, project: @project) %>'
end

View File

@ -0,0 +1,11 @@
- if User.current.admin?
- if project.archived?
= link_to l(:button_unarchive),
unarchive_project_path(project, status: params[:status]),
method: :post, class: 'icon icon-unlock'
- else
= link_to l(:button_archive),
archive_project_path(project, status: params[:status]),
data: { confirm: l(:text_are_you_sure) }, method: :post, class: 'icon icon-lock'
= link_to l(:button_copy), copy_project_path(project), class: 'icon icon-copy'
= link_to l(:button_delete), project_path(project), method: :delete, class: 'icon icon-del'

View File

@ -22,6 +22,7 @@ module Additionals
render_on(:view_my_account_preferences, partial: 'users/autowatch_involved_issue')
render_on(:view_users_form_preferences, partial: 'users/autowatch_involved_issue')
render_on(:view_users_show_contextual, partial: 'users/additionals_contextual')
render_on(:view_projects_show_actions_dropdown, partial: 'projects/additionals_show_actions_dropdown') if Redmine::VERSION.to_s >= '4.1'
def helper_issues_show_detail_after_setting(context = {})
detail = context[:detail]