From e96374b74bc791858951d21d1a2dd7fb5fbaa1c9 Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Mon, 20 May 2013 14:22:18 +0300 Subject: [PATCH] Better remove project message --- app/helpers/projects_helper.rb | 4 ++++ app/helpers/user_teams_helper.rb | 1 - app/views/admin/projects/index.html.haml | 2 +- app/views/projects/edit.html.haml | 2 +- app/views/projects/empty.html.haml | 2 +- 5 files changed, 7 insertions(+), 4 deletions(-) diff --git a/app/helpers/projects_helper.rb b/app/helpers/projects_helper.rb index 1db8b7c689c..9b142714980 100644 --- a/app/helpers/projects_helper.rb +++ b/app/helpers/projects_helper.rb @@ -44,4 +44,8 @@ module ProjectsHelper project.name end end + + def remove_project_message(project) + "You are going to remove #{project.name_with_namespace}.\n Removed project CANNOT be restored!\n Are you ABSOLUTELY sure?" + end end diff --git a/app/helpers/user_teams_helper.rb b/app/helpers/user_teams_helper.rb index 2055bb3c8bc..8603ee434a8 100644 --- a/app/helpers/user_teams_helper.rb +++ b/app/helpers/user_teams_helper.rb @@ -22,5 +22,4 @@ module UserTeamsHelper def remove_from_user_team_message(team, member) "You are going to remove #{member.name} from #{team.name}. Are you sure?" end - end diff --git a/app/views/admin/projects/index.html.haml b/app/views/admin/projects/index.html.haml index aa006dfc997..59831d83cc2 100644 --- a/app/views/admin/projects/index.html.haml +++ b/app/views/admin/projects/index.html.haml @@ -53,7 +53,7 @@ = link_to project.name_with_namespace, [:admin, project] .pull-right = link_to 'Edit', edit_project_path(project), id: "edit_#{dom_id(project)}", class: "btn btn-small" - = link_to 'Destroy', [project], confirm: "REMOVE #{project.name}? Are you sure?", method: :delete, class: "btn btn-small btn-remove" + = link_to 'Destroy', [project], confirm: remove_project_message(project), method: :delete, class: "btn btn-small btn-remove" - if @projects.blank? %p.nothing_here_message 0 projects matches = paginate @projects, theme: "gitlab" diff --git a/app/views/projects/edit.html.haml b/app/views/projects/edit.html.haml index dd087100e4c..d57aa83ec2b 100644 --- a/app/views/projects/edit.html.haml +++ b/app/views/projects/edit.html.haml @@ -147,7 +147,7 @@ %p %strong Removed project can not be restored! - = link_to 'Remove project', @project, confirm: 'Removed project can not be restored! Are you sure?', method: :delete, class: "btn btn-remove btn-small" + = link_to 'Remove project', @project, confirm: remove_project_message(@project), method: :delete, class: "btn btn-remove btn-small" - else %p.nothing_here_message Only project owner can remove a project diff --git a/app/views/projects/empty.html.haml b/app/views/projects/empty.html.haml index b1795b301b0..56dbbf0755e 100644 --- a/app/views/projects/empty.html.haml +++ b/app/views/projects/empty.html.haml @@ -31,4 +31,4 @@ - if can? current_user, :remove_project, @project .prepend-top-20 - = link_to 'Remove project', @project, confirm: 'Are you sure?', method: :delete, class: "btn btn-remove pull-right" + = link_to 'Remove project', @project, confirm: remove_project_message(@project), method: :delete, class: "btn btn-remove pull-right"