Commit e96374b74bc791858951d21d1a2dd7fb5fbaa1c9
1 parent
edc2e0a6
Exists in
master
and in
4 other branches
Better remove project message
Showing
5 changed files
with
7 additions
and
4 deletions
Show diff stats
app/helpers/projects_helper.rb
@@ -44,4 +44,8 @@ module ProjectsHelper | @@ -44,4 +44,8 @@ module ProjectsHelper | ||
44 | project.name | 44 | project.name |
45 | end | 45 | end |
46 | end | 46 | end |
47 | + | ||
48 | + def remove_project_message(project) | ||
49 | + "You are going to remove #{project.name_with_namespace}.\n Removed project CANNOT be restored!\n Are you ABSOLUTELY sure?" | ||
50 | + end | ||
47 | end | 51 | end |
app/helpers/user_teams_helper.rb
@@ -22,5 +22,4 @@ module UserTeamsHelper | @@ -22,5 +22,4 @@ module UserTeamsHelper | ||
22 | def remove_from_user_team_message(team, member) | 22 | def remove_from_user_team_message(team, member) |
23 | "You are going to remove #{member.name} from #{team.name}. Are you sure?" | 23 | "You are going to remove #{member.name} from #{team.name}. Are you sure?" |
24 | end | 24 | end |
25 | - | ||
26 | end | 25 | end |
app/views/admin/projects/index.html.haml
@@ -53,7 +53,7 @@ | @@ -53,7 +53,7 @@ | ||
53 | = link_to project.name_with_namespace, [:admin, project] | 53 | = link_to project.name_with_namespace, [:admin, project] |
54 | .pull-right | 54 | .pull-right |
55 | = link_to 'Edit', edit_project_path(project), id: "edit_#{dom_id(project)}", class: "btn btn-small" | 55 | = link_to 'Edit', edit_project_path(project), id: "edit_#{dom_id(project)}", class: "btn btn-small" |
56 | - = link_to 'Destroy', [project], confirm: "REMOVE #{project.name}? Are you sure?", method: :delete, class: "btn btn-small btn-remove" | 56 | + = link_to 'Destroy', [project], confirm: remove_project_message(project), method: :delete, class: "btn btn-small btn-remove" |
57 | - if @projects.blank? | 57 | - if @projects.blank? |
58 | %p.nothing_here_message 0 projects matches | 58 | %p.nothing_here_message 0 projects matches |
59 | = paginate @projects, theme: "gitlab" | 59 | = paginate @projects, theme: "gitlab" |
app/views/projects/edit.html.haml
@@ -147,7 +147,7 @@ | @@ -147,7 +147,7 @@ | ||
147 | %p | 147 | %p |
148 | %strong Removed project can not be restored! | 148 | %strong Removed project can not be restored! |
149 | 149 | ||
150 | - = link_to 'Remove project', @project, confirm: 'Removed project can not be restored! Are you sure?', method: :delete, class: "btn btn-remove btn-small" | 150 | + = link_to 'Remove project', @project, confirm: remove_project_message(@project), method: :delete, class: "btn btn-remove btn-small" |
151 | - else | 151 | - else |
152 | %p.nothing_here_message Only project owner can remove a project | 152 | %p.nothing_here_message Only project owner can remove a project |
153 | 153 |
app/views/projects/empty.html.haml
@@ -31,4 +31,4 @@ | @@ -31,4 +31,4 @@ | ||
31 | 31 | ||
32 | - if can? current_user, :remove_project, @project | 32 | - if can? current_user, :remove_project, @project |
33 | .prepend-top-20 | 33 | .prepend-top-20 |
34 | - = link_to 'Remove project', @project, confirm: 'Are you sure?', method: :delete, class: "btn btn-remove pull-right" | 34 | + = link_to 'Remove project', @project, confirm: remove_project_message(@project), method: :delete, class: "btn btn-remove pull-right" |