OSDN Git Service

Better remove project message
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
Mon, 20 May 2013 11:22:18 +0000 (14:22 +0300)
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
Mon, 20 May 2013 11:22:18 +0000 (14:22 +0300)
app/helpers/projects_helper.rb
app/helpers/user_teams_helper.rb
app/views/admin/projects/index.html.haml
app/views/projects/edit.html.haml
app/views/projects/empty.html.haml

index 1db8b7c..9b14271 100644 (file)
@@ -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
index 2055bb3..8603ee4 100644 (file)
@@ -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
index aa006df..59831d8 100644 (file)
@@ -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"
index dd08710..d57aa83 100644 (file)
                   %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
 
index b1795b3..56dbbf0 100644 (file)
@@ -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"