Commit 246989bcca07e71bcec37886d0303a22e4da8420

Authored by Dmitriy Zaporozhets
1 parent 8ab44f68

more descriptive confirmation messages

app/helpers/tree_helper.rb
... ... @@ -85,4 +85,8 @@ module TreeHelper
85 85 file = File.join(tree.path, "..")
86 86 tree_join(tree.ref, file)
87 87 end
  88 +
  89 + def leave_edit_message
  90 + "Leave edit mode?\nAll unsaved changes will be lost."
  91 + end
88 92 end
... ...
app/views/deploy_keys/_deploy_key.html.haml
... ... @@ -10,7 +10,7 @@
10 10 %i.icon-off
11 11 Disable
12 12 - else
13   - = link_to 'Remove', project_deploy_key_path(@project, deploy_key), confirm: 'Are you sure?', method: :delete, class: "btn btn-remove delete-key btn-small pull-right"
  13 + = link_to 'Remove', project_deploy_key_path(@project, deploy_key), confirm: 'You are going to remove deploy key. Are you sure?', method: :delete, class: "btn btn-remove delete-key btn-small pull-right"
14 14  
15 15  
16 16 = link_to project_deploy_key_path(deploy_key.projects.include?(@project) ? @project : deploy_key.projects.first, deploy_key) do
... ...
app/views/edit_tree/show.html.haml
... ... @@ -10,7 +10,7 @@
10 10 %strong= @ref
11 11 %span.options
12 12 .btn-group.tree-btn-group
13   - = link_to "Cancel", project_blob_path(@project, @id), class: "btn btn-tiny btn-cancel", confirm: "Are you sure?"
  13 + = link_to "Cancel", project_blob_path(@project, @id), class: "btn btn-tiny btn-cancel", confirm: leave_edit_message
14 14 .file_content.code
15 15 %pre#editor= @blob.data
16 16  
... ... @@ -27,7 +27,7 @@
27 27 .message
28 28 to branch
29 29 %strong= @ref
30   - = link_to "Cancel", project_blob_path(@project, @id), class: "btn btn-cancel", confirm: "Are you sure?"
  30 + = link_to "Cancel", project_blob_path(@project, @id), class: "btn btn-cancel", confirm: leave_edit_message
31 31  
32 32 :javascript
33 33 ace.config.set("modePath", "#{Gitlab::Application.config.assets.prefix}/ace-src-noconflict")
... ...
app/views/groups/edit.html.haml
... ... @@ -26,7 +26,7 @@
26 26 .pull-right
27 27 = link_to 'Team', project_team_index_path(project), id: "edit_#{dom_id(project)}", class: "btn btn-small"
28 28 = link_to 'Edit', edit_project_path(project), id: "edit_#{dom_id(project)}", class: "btn btn-small"
29   - = link_to 'Remove', project, confirm: "REMOVE #{project.name}? Are you sure?", method: :delete, class: "btn btn-small btn-remove"
  29 + = link_to 'Remove', project, remove_project_message(project), method: :delete, class: "btn btn-small btn-remove"
30 30 - if @group.projects.blank?
31 31 %p.nothing_here_message This group has no projects yet
32 32  
... ...
app/views/protected_branches/index.html.haml
... ... @@ -51,4 +51,4 @@
51 51 (branch was removed from repository)
52 52 %td
53 53 - if can? current_user, :admin_project, @project
54   - = link_to 'Unprotect', [@project, branch], confirm: 'Are you sure?', method: :delete, class: "btn btn-remove btn-small"
  54 + = link_to 'Unprotect', [@project, branch], confirm: 'Branch will be writable for developers. Are you sure?', method: :delete, class: "btn btn-remove btn-small"
... ...
app/views/snippets/_form.html.haml
... ... @@ -30,7 +30,7 @@
30 30 = f.submit 'Save', class: "btn-save btn"
31 31 = link_to "Cancel", project_snippets_path(@project), class: " btn"
32 32 - unless @snippet.new_record?
33   - .pull-right= link_to 'Destroy', [@project, @snippet], confirm: 'Are you sure?', method: :delete, class: "btn pull-right danger delete-snippet", id: "destroy_snippet_#{@snippet.id}"
  33 + .pull-right= link_to 'Destroy', [@project, @snippet], confirm: 'Removed snippet cannot be restored! Are you sure?', method: :delete, class: "btn pull-right danger delete-snippet", id: "destroy_snippet_#{@snippet.id}"
34 34  
35 35  
36 36 :javascript
... ...