From 217fdf83b4250bb0d6df8cb853ab1b8f9a3366a7 Mon Sep 17 00:00:00 2001 From: Stas Vilchik Date: Mon, 23 Jun 2014 15:24:21 +0600 Subject: [PATCH] SONAR-5333 Improve links consistency --- .../widgets/hotspots/hotspot_metric.html.erb | 6 ++-- .../hotspot_most_violated_resources.html.erb | 4 +-- .../hotspot_most_violated_rules.html.erb | 6 ++-- sonar-server/src/main/less/dashboard.less | 3 +- sonar-server/src/main/less/layout.less | 1 - sonar-server/src/main/less/style.less | 2 +- sonar-server/src/main/less/ui.less | 33 +++++++------------ .../WEB-INF/app/helpers/application_helper.rb | 2 +- .../WEB-INF/app/helpers/measures_helper.rb | 2 +- .../app/views/components/index.html.erb | 2 +- .../app/views/drilldown/_severity.html.erb | 2 +- .../app/views/drilldown/issues.html.erb | 6 ++-- .../app/views/drilldown/measures.html.erb | 2 +- 13 files changed, 30 insertions(+), 41 deletions(-) diff --git a/plugins/sonar-core-plugin/src/main/resources/org/sonar/plugins/core/widgets/hotspots/hotspot_metric.html.erb b/plugins/sonar-core-plugin/src/main/resources/org/sonar/plugins/core/widgets/hotspots/hotspot_metric.html.erb index 103b9ac8bad..bf2872762d8 100644 --- a/plugins/sonar-core-plugin/src/main/resources/org/sonar/plugins/core/widgets/hotspots/hotspot_metric.html.erb +++ b/plugins/sonar-core-plugin/src/main/resources/org/sonar/plugins/core/widgets/hotspots/hotspot_metric.html.erb @@ -40,7 +40,7 @@
- <%= message('widget.hotspot_metric.more') -%> + <%= message('widget.hotspot_metric.more') -%>

<%= title -%>

@@ -63,14 +63,14 @@ %> - <%= link_to_resource(resource, h(resource.name), {:metric => metric.name}) -%> + <%= link_to_resource(resource, h(resource.name), {:metric => metric.name, :class => 'underlined-link'}) -%> <%= format_measure(measure) -%>
-
+
diff --git a/plugins/sonar-core-plugin/src/main/resources/org/sonar/plugins/core/widgets/hotspots/hotspot_most_violated_resources.html.erb b/plugins/sonar-core-plugin/src/main/resources/org/sonar/plugins/core/widgets/hotspots/hotspot_most_violated_resources.html.erb index f9697b58ab2..8bd76b5af67 100644 --- a/plugins/sonar-core-plugin/src/main/resources/org/sonar/plugins/core/widgets/hotspots/hotspot_most_violated_resources.html.erb +++ b/plugins/sonar-core-plugin/src/main/resources/org/sonar/plugins/core/widgets/hotspots/hotspot_most_violated_resources.html.erb @@ -40,7 +40,7 @@
- <%= message('widget.hotspot_metric.more') -%> + <%= message('widget.hotspot_metric.more') -%>

<%= title -%>

@@ -63,7 +63,7 @@ %> - <%= link_to_resource(resource, h(resource.name), {:tab => :violations}) -%> + <%= link_to_resource(resource, h(resource.name), {:tab => :violations, :class => 'underlined-link'}) -%> diff --git a/plugins/sonar-core-plugin/src/main/resources/org/sonar/plugins/core/widgets/hotspots/hotspot_most_violated_rules.html.erb b/plugins/sonar-core-plugin/src/main/resources/org/sonar/plugins/core/widgets/hotspots/hotspot_most_violated_rules.html.erb index 2618f3cd952..d30b7b700db 100644 --- a/plugins/sonar-core-plugin/src/main/resources/org/sonar/plugins/core/widgets/hotspots/hotspot_most_violated_rules.html.erb +++ b/plugins/sonar-core-plugin/src/main/resources/org/sonar/plugins/core/widgets/hotspots/hotspot_most_violated_rules.html.erb @@ -38,7 +38,7 @@
- + <%= message('widget.hotspot_metric.more') -%>
@@ -97,13 +97,13 @@ <%= h rule.name -%> - + <%= dashboard_configuration.selected_period? ? format_variation(m) : format_measure(m) -%>
-
+
diff --git a/sonar-server/src/main/less/dashboard.less b/sonar-server/src/main/less/dashboard.less index de628316f9f..6d9a149ae59 100644 --- a/sonar-server/src/main/less/dashboard.less +++ b/sonar-server/src/main/less/dashboard.less @@ -74,8 +74,7 @@ } #dashboard .widget-title a { - .base-link; - .chevron-link; + .highlighted-link; } /*CONFIGURATION*/ diff --git a/sonar-server/src/main/less/layout.less b/sonar-server/src/main/less/layout.less index 69d93189211..86cda25ce4f 100644 --- a/sonar-server/src/main/less/layout.less +++ b/sonar-server/src/main/less/layout.less @@ -224,7 +224,6 @@ ul.sidebar li { ul.sidebar li > a { .highlighted-link; - .chevron-link; } ul.sidebar li.active { diff --git a/sonar-server/src/main/less/style.less b/sonar-server/src/main/less/style.less index 26e3c87b43b..2cf665fa67b 100644 --- a/sonar-server/src/main/less/style.less +++ b/sonar-server/src/main/less/style.less @@ -2060,7 +2060,7 @@ div.barchart { } div.barchart > div { - background-color: #4B9FD5; + background-color: @darkBlue; height: 0.9em; } diff --git a/sonar-server/src/main/less/ui.less b/sonar-server/src/main/less/ui.less index 7b978880ecd..855473bce36 100644 --- a/sonar-server/src/main/less/ui.less +++ b/sonar-server/src/main/less/ui.less @@ -71,10 +71,6 @@ select::-moz-focus-inner, input::-moz-focus-inner, button::-moz-focus-inner { * Links */ -a { - cursor: pointer; -} - .link() { outline: none; text-decoration: none; @@ -87,23 +83,6 @@ a { } } -.chevron-link { - &:after { - content: "\f105"; - position: relative; - top: -1px; - vertical-align: middle; - margin-left: 0.4em; - font-family: 'sonar'; - speak: none; - font-style: normal; - font-weight: normal; - font-variant: normal; - text-transform: none; - line-height: 1; - } -} - .base-link { color: @baseFontColor; .link; @@ -114,6 +93,13 @@ a { .link; } +.underlined-link { + .highlighted-link; + border-bottom: 1px solid @lightBlue; + + &.link-red { .widget-link-red; } +} + .icon-with-link { outline: none; text-decoration: none; @@ -134,6 +120,11 @@ a { } } +a { + cursor: pointer; + .highlighted-link; +} + /* diff --git a/sonar-server/src/main/webapp/WEB-INF/app/helpers/application_helper.rb b/sonar-server/src/main/webapp/WEB-INF/app/helpers/application_helper.rb index d1a7a8c67d2..275226c8250 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/helpers/application_helper.rb +++ b/sonar-server/src/main/webapp/WEB-INF/app/helpers/application_helper.rb @@ -323,7 +323,7 @@ module ApplicationHelper anchor= 'L' + options[:line].to_s end link_to(name || resource.name, {:controller => 'resource', :action => 'index', :anchor => anchor, :id => resource.id, :period => period_index, :tab => options[:tab], :rule => options[:rule], - :metric => options[:metric], :display_title => true}, :popup => ['resource', 'height=800,width=900,scrollbars=1,resizable=1'], :title => options[:title]) + :metric => options[:metric], :display_title => true}, :popup => ['resource', 'height=800,width=900,scrollbars=1,resizable=1'], :title => options[:title], :class => options[:class]) end end diff --git a/sonar-server/src/main/webapp/WEB-INF/app/helpers/measures_helper.rb b/sonar-server/src/main/webapp/WEB-INF/app/helpers/measures_helper.rb index 5e3a31dbe50..ca4472c524b 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/helpers/measures_helper.rb +++ b/sonar-server/src/main/webapp/WEB-INF/app/helpers/measures_helper.rb @@ -50,7 +50,7 @@ module MeasuresHelper end elsif column.key=='name' - "#{qualifier_icon(row.snapshot)} #{link_to(h(row.snapshot.resource.name(true)), {:controller => 'dashboard', :id => row.snapshot.resource_id}, {:title => h(row.snapshot.resource.key), :class => 'highlighted-link chevron-link'})}" + "#{qualifier_icon(row.snapshot)} #{link_to(h(row.snapshot.resource.name(true)), {:controller => 'dashboard', :id => row.snapshot.resource_id}, {:title => h(row.snapshot.resource.key), :class => 'underlined-link'})}" elsif column.key=='short_name' "#{qualifier_icon(row.snapshot)} #{link_to(h(row.snapshot.resource.name(false)), {:controller => 'dashboard', :id => row.snapshot.resource_id}, {:title => h(row.snapshot.resource.key), :class => 'highlighted-link'})}" elsif column.key=='date' diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/components/index.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/components/index.html.erb index 0ce35cae214..8ad4f2424ba 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/views/components/index.html.erb +++ b/sonar-server/src/main/webapp/WEB-INF/app/views/components/index.html.erb @@ -53,7 +53,7 @@ <%= qualifier_icon(snapshot) %> <% if snapshot.display_dashboard? %> - <%= link_to_resource(project, h(snapshot.project.name), :class => 'chevron-link highlighted-link') %> + <%= link_to_resource(project, h(snapshot.project.name), :class => 'underlined-link') %> <% else %> <%= h snapshot.project.name %> <% end %> diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/drilldown/_severity.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/drilldown/_severity.html.erb index ebaeb1f8617..cb890b1cf7a 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/views/drilldown/_severity.html.erb +++ b/sonar-server/src/main/webapp/WEB-INF/app/views/drilldown/_severity.html.erb @@ -2,7 +2,7 @@ - <%= link_to message("severity.#{severity}"), {:controller => :drilldown, :action => :issues, :id => @resource.id, :severity => (selected ? nil : severity), :period => @period}, :class => 'chevron-link highlighted-link' %> + <%= link_to message("severity.#{severity}"), {:controller => :drilldown, :action => :issues, :id => @resource.id, :severity => (selected ? nil : severity), :period => @period}, :class => 'underlined-link' %> <%= @period ? format_variation(measure, :index => @period, :style => 'light') : format_measure(measure) -%> diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/drilldown/issues.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/drilldown/issues.html.erb index 9f27edc2855..1c3761ac0de 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/views/drilldown/issues.html.erb +++ b/sonar-server/src/main/webapp/WEB-INF/app/views/drilldown/issues.html.erb @@ -101,7 +101,7 @@ :rule_sev => (selected ? nil : rule_measure.severity), :sid => nil, :severity => @severity, :period => @period, :rids => (selected ? nil : @selected_rids)}, :title => "#{rule.plugin_name}: #{rule.plugin_rule_key}", - :class => 'chevron-link highlighted-link' + :class => 'underlined-link' ) -%> @@ -161,9 +161,9 @@ <%= qualifier_icon(resource) -%>  <% if resource.source_code? %> <%= h resource.name(false) %> + class="js-drilldown-link underlined-link"><%= h resource.name(false) %> <% else %> - <%= link_to(h(resource.name), {:only_path => true, :overwrite_params => {:rids => (selected ? rids-[resource.id] : rids+[resource.id])}}, :class => 'chevron-link highlighted-link') -%> + <%= link_to(h(resource.name), {:only_path => true, :overwrite_params => {:rids => (selected ? rids-[resource.id] : rids+[resource.id])}}, :class => 'underlined-link') -%> <% end %> diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/drilldown/measures.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/drilldown/measures.html.erb index b2133dc6896..720a5313ffd 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/views/drilldown/measures.html.erb +++ b/sonar-server/src/main/webapp/WEB-INF/app/views/drilldown/measures.html.erb @@ -85,7 +85,7 @@ <%= qualifier_icon(resource) -%>  <% if resource.source_code? %> <%= h resource.name(false) %> + class="js-drilldown-link underlined-link"><%= h resource.name(false) %> <% else %> <%= link_to(h(resource.name), {:only_path => true, :overwrite_params => {:rids => (selected ? rids-[resource.id] : rids+[resource.id])}}, :class => 'chevron-link highlighted-link') -%> <% end %> -- 2.39.5