]> source.dussan.org Git - sonarqube.git/commitdiff
Homogeneous pattern for displaying action links (to POST requests)
authorSimon Brandhof <simon.brandhof@gmail.com>
Sun, 30 Sep 2012 17:04:28 +0000 (19:04 +0200)
committerSimon Brandhof <simon.brandhof@gmail.com>
Sun, 30 Sep 2012 17:05:20 +0000 (19:05 +0200)
plugins/sonar-core-plugin/src/main/resources/org/sonar/l10n/core.properties
sonar-server/src/main/webapp/WEB-INF/app/views/action_plans/index.html.erb
sonar-server/src/main/webapp/WEB-INF/app/views/filters/manage.html.erb
sonar-server/src/main/webapp/WEB-INF/app/views/groups/index.html.erb
sonar-server/src/main/webapp/WEB-INF/app/views/manual_measures/index.html.erb
sonar-server/src/main/webapp/WEB-INF/app/views/manual_rules/index.html.erb
sonar-server/src/main/webapp/WEB-INF/app/views/metrics/index.html.erb
sonar-server/src/main/webapp/WEB-INF/app/views/profiles/index.html.erb
sonar-server/src/main/webapp/WEB-INF/app/views/users/index.html.erb
sonar-server/src/main/webapp/stylesheets/style.css

index 5003e8c59c80d22a27a6f5a47f2083abd03dad95..39188f479158c1894170c49f8c17b859a30ebec6 100644 (file)
@@ -1147,7 +1147,7 @@ quality_profiles.new_profile=New profile
 quality_profiles.compare_profiles=Compare profiles
 quality_profiles.restore_profile=Restore profile
 quality_profiles.restore_submit=Restore
-quality_profiles.x_language_profiles= {0} profiles
+quality_profiles.x_language_profiles={0} Profiles
 quality_profiles.optional_configuration_file=Optional configuration file
 quality_profiles.create_x_language_profile=Create {0} Profile
 quality_profiles.are_you_sure_want_x_profile_as_default=Are you sure that you want to set the profile "{0}" as default ?
index 6e42be6629476d07722d2e3f2672a92ec50df1fc..59c3607b87fe52ccf5845294ed0a222b92ac13a5 100644 (file)
@@ -40,7 +40,7 @@
             <td id="desc"><%= h(plan.user.name) -%></td>
             <td class="thin nowrap right">
               <%= link_to message('edit'), {:action => 'edit', :id => @resource.id, :plan_id => plan.id}, :class => 'link-action' -%>
-              |
+              &nbsp;
               <% 
                 close_confirmation_message = {}
                 if plan.open? && plan.has_open_reviews?
@@ -49,8 +49,8 @@
               %>
               <%= link_to message('action_plans.close'), 
                           {:action => 'change_status', :id => @resource.id, :plan_id => plan.id}, {:method => 'POST', :class => 'link-action'}.merge(close_confirmation_message) -%>
-              |
-              <%= link_to message('delete'), {:action => 'delete', :id => @resource.id, :plan_id => plan.id}, {:method => 'POST', :confirm => message('action_plans.confirm_delete'), :class => 'link-action'} -%>
+              &nbsp;
+              <%= link_to message('delete'), {:action => 'delete', :id => @resource.id, :plan_id => plan.id}, {:method => 'POST', :confirm => message('action_plans.confirm_delete'), :class => 'link-action link-red'} -%>
             </td>
           </tr>
         <% end %>
index 001c37a0af6d3d8a4f074988c7961d813a10ee80..c306fe557c46a96e55d07af8c6870c68065c12ed 100644 (file)
@@ -34,8 +34,9 @@
           </td>
           <td class="thin nowrap right">
             <% if filter.authorized_to_edit?(self) %>
-              <%= link_to message('edit'), {:action => :edit, :id => filter.id}, :id => "edit-#{u filter.name}", :class => 'link-action' %> |
-              <%= link_to message('delete'), {:action => :delete, :id => filter.id}, :method => :post, :confirm => message('filters.do_you_want_to_delete'), :id => "delete-#{u filter.name}", :class => 'link-action' %>
+              <%= link_to message('edit'), {:action => :edit, :id => filter.id}, :id => "edit-#{u filter.name}", :class => 'link-action' %>
+              &nbsp;
+              <%= link_to message('delete'), {:action => :delete, :id => filter.id}, :method => :post, :confirm => message('filters.do_you_want_to_delete'), :id => "delete-#{u filter.name}", :class => 'link-action link-red' %>
             <% end %>
           </td>
         </tr>
index b281d3fd66eb3b4b598f524606fc65dc41e4c602..a54f1e969ae25dbe4fffb3a630c62b84ebcce081 100644 (file)
@@ -23,9 +23,9 @@
             <td class="left">
               <%= link_to "Edit", { :action => 'index', :id => group.id},
                                   { :method => :get, :id => "edit-#{u group.name}", :class => 'link-action'} %>
-              |
+              &nbsp;
               <%= link_to "Delete", { :action => 'destroy', :id => group.id},
-                                    {:confirm => "Are you sure that you want to delete this group? Members will not be deleted.", :class => 'link-action', :method => 'get', :id => "delete-#{u group.name}"} %>
+                                    {:confirm => "Are you sure that you want to delete this group? Members will not be deleted.", :class => 'link-action link-red', :method => 'get', :id => "delete-#{u group.name}"} %>
             </td>
           </tr>
         <% end %>
index a1d0b4604bc8bb9ffbe7dc13747cdfec5d3a1bb2..9d8e8a2b52e9fc00f52ea8f8c45ea76223ded6ef 100644 (file)
       <td class="thin nowrap">
         <a href="<%= url_for :controller => 'manual_measures', :action => 'new', :metric => measure.metric.key, :id => @resource.id -%>" class="link-action"><%= message('edit')
         -%></a>
-        |
+        &nbsp;
         <%= link_to message('delete'), {:action => 'delete', :metric => measure.metric.key, :id => @resource.id}, {:method => 'POST',
                                                                                                                    :confirm => "This measure will be deleted during next project
-                                                                                                                   analysis", :class => 'link-action'} -%>
+                                                                                                                   analysis", :class => 'link-action link-red'} -%>
       </td>
     </tr>
   <% end %>
index ce284dad24eec9c6ea5acda3f61ca514dd8acb42..3408571000225787ce85e4d6140fc7eae3c7d989 100644 (file)
@@ -24,7 +24,8 @@
             </td>
             <td class="right thin nowrap">
               <%= link_to 'Edit', {:action => 'edit', :id => rule.id}, {:id => "edit_#{u(rule.key)}", :class => 'link-action'} %>
-              <%= link_to 'Delete', {:action => 'delete', :id => rule.id}, {:confirm => message('are_you_sure'), :id => "delete_#{u(rule.key)}", :class => 'link-action', :method => 'delete'} %>
+              &nbsp;
+              <%= link_to 'Delete', {:action => 'delete', :id => rule.id}, {:confirm => message('are_you_sure'), :id => "delete_#{u(rule.key)}", :class => 'link-action link-red', :method => 'delete'} %>
             </td>
           </tr>
         <% end %>
index e2957f6507016307dcface89cee7b6cf6cabf084..411bd851ab6319990b47eca6b2e5a39554f96b5a 100644 (file)
@@ -26,7 +26,8 @@
               <%= link_to 'Edit', {:action => 'index', :id => metric.id}, {:class => 'link-action', :id => "edit_#{h(metric.short_name)}", :method => 'get'} %>
             <% end %>
             <% if is_admin? && metric.updatable_online? %>
-              <%= link_to 'Delete', {:action => 'delete_from_web', :id => metric.id}, {:confirm => "Warning : all the measures will be deleted.", :class => 'link-action', :id => "delete_#{h(metric.short_name)}"} %>
+              &nbsp;
+              <%= link_to 'Delete', {:action => 'delete_from_web', :id => metric.id}, {:confirm => "Warning : all the measures will be deleted.", :class => 'link-action link-red', :id => "delete_#{h(metric.short_name)}"} %>
             <% end %>
           </td>
         </tr>
index 8a308747afacb86be2b9ab3d4456095a4b41dac4..cba2a1f0be909765a006134d7942b7c7ba621c1b 100644 (file)
@@ -21,8 +21,8 @@
     <% if administrator? %>
       <ul style="float: right" class="horizontal">
         <li class="marginleft10 add">
-          <a id="create-link-<%= language.getKey() -%>" href="profiles/create_form?language=<%= language.getKey() -%>" class="open-modal"><%= message('create') -%></a>
-      </li>
+          <a id="create-link-<%= language.getKey() -%>" href="profiles/create_form?language=<%= language.getKey() -%>" class="open-modal link-action"><%= message('create') -%></a>
+        </li>
       </ul>
     <% end %>
     <h2><%= message('quality_profiles.x_language_profiles', :params => language.getName()) -%></h2>
     <tbody>
     <% @profiles.select { |p| p.language==language.getKey() }.each do |profile| %>
       <tr class="<%= cycle 'even', 'odd', :name => language.getKey() -%>" id="<%= u profile.key %>">
-        <td>
+        <td  width="40%">
           <a href="<%= url_for :controller => 'rules_configuration', :action => 'index', :id => profile.id -%>" id="rules-<%= language.getKey() -%>-<%= u(profile.name) -%>"><%= h profile.name %></a>
         </td>
 
-        <td align="right">
+        <td align="right" width="10%">
           <span id="activated_rules_<%= u profile.key -%>"><%= profile.active_rules.count -%></span>
         </td>
 
-        <td align="right"><span id="alerts_<%= u profile.key -%>"><%= profile.alerts.size -%></span></td>
+        <td align="right" width="10%"><span id="alerts_<%= u profile.key -%>"><%= profile.alerts.size -%></span></td>
 
-        <td align="right">
+        <td align="right" width="10%" nowrap>
           <% unless profile.default_profile? %>
             <span id="projects_<%= u profile.key -%>"><%= profile.projects.size -%></span>
           <% end %>
         </td>
 
-        <td align="right">
+        <td align="right" width="10%" nowrap>
           <% if !profile.default_profile? && administrator? %>
             <%= link_to_action message('set_as_default'), "profiles/set_as_default?id=#{profile.id}",
-                                               :id => "activate_#{profile.key.parameterize}",
-                                               :class => 'button',
-                                               :confirm_title => 'set_as_default',
-                                               :confirm_msg => 'quality_profiles.are_you_sure_want_x_profile_as_default',
-                                               :confirm_msg_params => [profile.name] -%>
+                               :id => "activate_#{profile.key.parameterize}",
+                               :class => 'link-action',
+                               :confirm_title => message('set_as_default'),
+                               :confirm_msg => message('quality_profiles.are_you_sure_want_x_profile_as_default', :params => [profile.name]),
+                               :confirm_button => message('set_as_default')
+            -%>
           <% end %>
           <% if profile.default_profile? %>
             <%= image_tag 'tick.png', :id => "is_active_#{u profile.key}" %>
 
           <td align="right">
             <% if !profile.provided? %>
-              <% form_tag(:action => 'backup', :id => profile.id) do -%>
-                <input type="submit" name="button_backup" id="backup_<%= u profile.key %>" value="<%= message('backup_verb') -%>"/>
-              <% end
-                 end %>
+              <form method="post" action="/dev/profiles/backup/<%= profile.id -%>" id="backup-<%= profile.key.parameterize -%>-form">
+                <a href="#" class="link-action" name="button_backup" id="backup_<%= u profile.key %>" onclick="$j('#backup-<%= profile.key.parameterize -%>-form').submit();return false;"><%= message('backup_verb') -%></a>
+              </form>
+            <% end %>
           </td>
 
           <td align="right">
             <% if !profile.provided? %>
-              <a id="rename-<%= profile.key.parameterize -%>" href="profiles/rename_form/<%= profile.id -%>" class="button open-modal"><%= message('rename') -%></a>
+              <a id="rename-<%= profile.key.parameterize -%>" href="profiles/rename_form/<%= profile.id -%>" class="link-action open-modal"><%= message('rename') -%></a>
             <% end %>
           </td>
 
           <td align="right">
-            <a id="copy-<%= profile.key.parameterize -%>" href="profiles/copy_form/<%= profile.id -%>" class="button open-modal"><%= message('copy') -%></a>
+            <a id="copy-<%= profile.key.parameterize -%>" href="profiles/copy_form/<%= profile.id -%>" class="link-action open-modal"><%= message('copy') -%></a>
           </td>
 
           <td>
             <% if profile.deletable? %>
               <%= link_to_action message('delete'), "profiles/delete/#{profile.id}",
-                                   :class => 'button red-button',
-                                   :id => "delete_#{profile.key.parameterize}",
-                                   :confirm_button => 'delete',
-                                   :confirm_title => 'quality_profiles.delete_confirm_title',
-                                   :confirm_msg => 'quality_profiles.are_you_sure_want_delete_profile_x',
-                                   :confirm_msg_params => [profile.name]
+                                 :class => 'link-action link-red',
+                                 :id => "delete_#{profile.key.parameterize}",
+                                 :confirm_button => message('delete'),
+                                 :confirm_title => 'quality_profiles.delete_confirm_title',
+                                 :confirm_msg => 'quality_profiles.are_you_sure_want_delete_profile_x',
+                                 :confirm_msg_params => [profile.name]
               -%>
             <% end %>
           </td>
index 9df129cb06163ad89448e77b0c97da980d785716..bddf12e12ed05e00e24ee0850170221011318117 100644 (file)
               </td>
               <td class="left" valign="top">
                 <%= link_to "Edit", { :id => user.id, :action => 'edit'}, {:id => "edit-#{u user.login}", :class => 'link-action'} %>
-                |
+                &nbsp;
                 <%= link_to "Change password", { :id => user.id, :action => 'change_password'}, {:id => "change-password-#{u user.login}", :class => 'link-action'} %>
-                |
+                &nbsp;
                 <%= link_to "Delete", {:action => 'destroy', :id => user.id}, {:confirm => "Warning : are you sure to delete this user ?", :method => 'delete',
-                                                                               :id => "delete-#{u user.login}", :class => 'link-action'} %>
+                                                                               :id => "delete-#{u user.login}", :class => 'link-action link-red'} %>
               </td>
             </tr>
           <% end %>
index 313d6ca1d6bcb986214f8f51ed179207a73b9531..d899710cd5cc8e96d920c26463e758e30baf19bb 100644 (file)
@@ -2120,6 +2120,11 @@ table.nowrap td, td.nowrap, th.nowrap {
   color: #4183C4 !important;
 }
 
+.link-red {
+  color: #990000 !important;
+}
+
+
 .link-more {
   background-image: url('../images/bullet_arrow_down.png');
   background-repeat: no-repeat;