Commit e96374b74bc791858951d21d1a2dd7fb5fbaa1c9

Authored by Dmitriy Zaporozhets
1 parent edc2e0a6

Better remove project message

app/helpers/projects_helper.rb
... ... @@ -44,4 +44,8 @@ module ProjectsHelper
44 44 project.name
45 45 end
46 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 51 end
... ...
app/helpers/user_teams_helper.rb
... ... @@ -22,5 +22,4 @@ module UserTeamsHelper
22 22 def remove_from_user_team_message(team, member)
23 23 "You are going to remove #{member.name} from #{team.name}. Are you sure?"
24 24 end
25   -
26 25 end
... ...
app/views/admin/projects/index.html.haml
... ... @@ -53,7 +53,7 @@
53 53 = link_to project.name_with_namespace, [:admin, project]
54 54 .pull-right
55 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 57 - if @projects.blank?
58 58 %p.nothing_here_message 0 projects matches
59 59 = paginate @projects, theme: "gitlab"
... ...
app/views/projects/edit.html.haml
... ... @@ -147,7 +147,7 @@
147 147 %p
148 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 151 - else
152 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 31  
32 32 - if can? current_user, :remove_project, @project
33 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"
... ...