From 7e7dccc3e5c8dbc11ccc0ca7defa9b26f2316246 Mon Sep 17 00:00:00 2001 From: Simon Brandhof Date: Sun, 30 Sep 2012 19:04:28 +0200 Subject: [PATCH] Homogeneous pattern for displaying action links (to POST requests) --- .../resources/org/sonar/l10n/core.properties | 2 +- .../app/views/action_plans/index.html.erb | 6 +-- .../WEB-INF/app/views/filters/manage.html.erb | 5 +- .../WEB-INF/app/views/groups/index.html.erb | 4 +- .../app/views/manual_measures/index.html.erb | 4 +- .../app/views/manual_rules/index.html.erb | 3 +- .../WEB-INF/app/views/metrics/index.html.erb | 3 +- .../WEB-INF/app/views/profiles/index.html.erb | 49 ++++++++++--------- .../WEB-INF/app/views/users/index.html.erb | 6 +-- .../src/main/webapp/stylesheets/style.css | 5 ++ 10 files changed, 48 insertions(+), 39 deletions(-) diff --git a/plugins/sonar-core-plugin/src/main/resources/org/sonar/l10n/core.properties b/plugins/sonar-core-plugin/src/main/resources/org/sonar/l10n/core.properties index 5003e8c59c8..39188f47915 100644 --- a/plugins/sonar-core-plugin/src/main/resources/org/sonar/l10n/core.properties +++ b/plugins/sonar-core-plugin/src/main/resources/org/sonar/l10n/core.properties @@ -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 ? diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/action_plans/index.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/action_plans/index.html.erb index 6e42be66294..59c3607b87f 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/views/action_plans/index.html.erb +++ b/sonar-server/src/main/webapp/WEB-INF/app/views/action_plans/index.html.erb @@ -40,7 +40,7 @@ <%= h(plan.user.name) -%> <%= link_to message('edit'), {:action => 'edit', :id => @resource.id, :plan_id => plan.id}, :class => 'link-action' -%> - | +   <% 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'} -%> +   + <%= 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'} -%> <% end %> diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/filters/manage.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/filters/manage.html.erb index 001c37a0af6..c306fe557c4 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/views/filters/manage.html.erb +++ b/sonar-server/src/main/webapp/WEB-INF/app/views/filters/manage.html.erb @@ -34,8 +34,9 @@ <% 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' %> +   + <%= 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 %> diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/groups/index.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/groups/index.html.erb index b281d3fd66e..a54f1e969ae 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/views/groups/index.html.erb +++ b/sonar-server/src/main/webapp/WEB-INF/app/views/groups/index.html.erb @@ -23,9 +23,9 @@ <%= link_to "Edit", { :action => 'index', :id => group.id}, { :method => :get, :id => "edit-#{u group.name}", :class => 'link-action'} %> - | +   <%= 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}"} %> <% end %> diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/manual_measures/index.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/manual_measures/index.html.erb index a1d0b4604bc..9d8e8a2b52e 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/views/manual_measures/index.html.erb +++ b/sonar-server/src/main/webapp/WEB-INF/app/views/manual_measures/index.html.erb @@ -62,10 +62,10 @@ <%= message('edit') -%> - | +   <%= 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'} -%> <% end %> diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/manual_rules/index.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/manual_rules/index.html.erb index ce284dad24e..34085710002 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/views/manual_rules/index.html.erb +++ b/sonar-server/src/main/webapp/WEB-INF/app/views/manual_rules/index.html.erb @@ -24,7 +24,8 @@ <%= 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'} %> +   + <%= 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'} %> <% end %> diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/metrics/index.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/metrics/index.html.erb index e2957f65070..411bd851ab6 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/views/metrics/index.html.erb +++ b/sonar-server/src/main/webapp/WEB-INF/app/views/metrics/index.html.erb @@ -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)}"} %> +   + <%= 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 %> diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/profiles/index.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/profiles/index.html.erb index 8a308747afa..cba2a1f0be9 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/views/profiles/index.html.erb +++ b/sonar-server/src/main/webapp/WEB-INF/app/views/profiles/index.html.erb @@ -21,8 +21,8 @@ <% if administrator? %> <% end %>

<%= message('quality_profiles.x_language_profiles', :params => language.getName()) -%>

@@ -44,30 +44,31 @@ <% @profiles.select { |p| p.language==language.getKey() }.each do |profile| %> - + <%= h profile.name %> - + <%= profile.active_rules.count -%> - <%= profile.alerts.size -%> + <%= profile.alerts.size -%> - + <% unless profile.default_profile? %> <%= profile.projects.size -%> <% end %> - + <% 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}" %> @@ -79,31 +80,31 @@ <% if !profile.provided? %> - <% form_tag(:action => 'backup', :id => profile.id) do -%> - - <% end - end %> +
+ <%= message('backup_verb') -%> +
+ <% end %> <% if !profile.provided? %> - <%= message('rename') -%> + <%= message('rename') -%> <% end %> - <%= message('copy') -%> + <%= message('copy') -%> <% 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 %> diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/users/index.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/users/index.html.erb index 9df129cb061..bddf12e12ed 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/views/users/index.html.erb +++ b/sonar-server/src/main/webapp/WEB-INF/app/views/users/index.html.erb @@ -23,11 +23,11 @@ <%= link_to "Edit", { :id => user.id, :action => 'edit'}, {:id => "edit-#{u user.login}", :class => 'link-action'} %> - | +   <%= link_to "Change password", { :id => user.id, :action => 'change_password'}, {:id => "change-password-#{u user.login}", :class => 'link-action'} %> - | +   <%= 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'} %> <% end %> diff --git a/sonar-server/src/main/webapp/stylesheets/style.css b/sonar-server/src/main/webapp/stylesheets/style.css index 313d6ca1d6b..d899710cd5c 100644 --- a/sonar-server/src/main/webapp/stylesheets/style.css +++ b/sonar-server/src/main/webapp/stylesheets/style.css @@ -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; -- 2.39.5