OSDN Git Service

more descriptive confirmation messages
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
Mon, 27 May 2013 12:43:44 +0000 (15:43 +0300)
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
Mon, 27 May 2013 12:43:44 +0000 (15:43 +0300)
app/helpers/tree_helper.rb
app/views/deploy_keys/_deploy_key.html.haml
app/views/edit_tree/show.html.haml
app/views/groups/edit.html.haml
app/views/protected_branches/index.html.haml
app/views/snippets/_form.html.haml

index 1f764ea..a8491df 100644 (file)
@@ -85,4 +85,8 @@ module TreeHelper
     file = File.join(tree.path, "..")
     tree_join(tree.ref, file)
   end
+
+  def leave_edit_message
+    "Leave edit mode?\nAll unsaved changes will be lost."
+  end
 end
index b2c59c1..45f80ec 100644 (file)
@@ -10,7 +10,7 @@
           %i.icon-off
           Disable
       - else
-        = 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"
+        = 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"
 
 
   = link_to project_deploy_key_path(deploy_key.projects.include?(@project) ? @project : deploy_key.projects.first, deploy_key) do
index 94a577d..17d813c 100644 (file)
@@ -10,7 +10,7 @@
             %strong= @ref
         %span.options
           .btn-group.tree-btn-group
-            = link_to "Cancel", project_blob_path(@project, @id), class: "btn btn-tiny btn-cancel", confirm: "Are you sure?"
+            = link_to "Cancel", project_blob_path(@project, @id), class: "btn btn-tiny btn-cancel", confirm: leave_edit_message
       .file_content.code
         %pre#editor= @blob.data
 
@@ -27,7 +27,7 @@
         .message
           to branch
           %strong= @ref
-      = link_to "Cancel", project_blob_path(@project, @id), class: "btn btn-cancel", confirm: "Are you sure?"
+      = link_to "Cancel", project_blob_path(@project, @id), class: "btn btn-cancel", confirm: leave_edit_message
 
 :javascript
   ace.config.set("modePath", "#{Gitlab::Application.config.assets.prefix}/ace-src-noconflict")
index eb4f324..d6a828f 100644 (file)
@@ -26,7 +26,7 @@
                 .pull-right
                   = link_to 'Team', project_team_index_path(project), id: "edit_#{dom_id(project)}", class: "btn btn-small"
                   = link_to 'Edit', edit_project_path(project), id: "edit_#{dom_id(project)}", class: "btn btn-small"
-                  = link_to 'Remove', project, confirm: "REMOVE #{project.name}? Are you sure?", method: :delete, class: "btn btn-small btn-remove"
+                  = link_to 'Remove', project, remove_project_message(project), method: :delete, class: "btn btn-small btn-remove"
             - if @group.projects.blank?
               %p.nothing_here_message This group has no projects yet
 
index 15644de..a338344 100644 (file)
@@ -51,4 +51,4 @@
                   (branch was removed from repository)
               %td
                 - if can? current_user, :admin_project, @project
-                  = link_to 'Unprotect', [@project, branch], confirm: 'Are you sure?', method: :delete, class: "btn btn-remove btn-small"
+                  = link_to 'Unprotect', [@project, branch], confirm: 'Branch will be writable for developers. Are you sure?', method: :delete, class: "btn btn-remove btn-small"
index 77162cd..993a200 100644 (file)
@@ -30,7 +30,7 @@
       = f.submit 'Save', class: "btn-save btn"
       = link_to "Cancel", project_snippets_path(@project), class: " btn"
       - unless @snippet.new_record?
-        .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}"
+        .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}"
 
 
 :javascript