diff options
author | Fabrice Bellingard <bellingard@gmail.com> | 2011-08-29 18:09:07 +0200 |
---|---|---|
committer | Fabrice Bellingard <bellingard@gmail.com> | 2011-08-29 18:14:04 +0200 |
commit | a5985a04a701a9bdae0718fa8b4945ce54c9ba27 (patch) | |
tree | 9e7568264b5f5ca5421ab913377f082248a7e720 | |
parent | ffc7f8ff6aad9be8615a66241c11ed3c63bf2620 (diff) | |
download | sonarqube-a5985a04a701a9bdae0718fa8b4945ce54c9ba27.tar.gz sonarqube-a5985a04a701a9bdae0718fa8b4945ce54c9ba27.zip |
SONAR-2701 Change TimeMachine widget style to match Sonar table style
-rw-r--r-- | plugins/sonar-core-plugin/src/main/resources/org/sonar/plugins/core/widgets/time_machine.html.erb | 46 | ||||
-rw-r--r-- | sonar-server/src/main/webapp/stylesheets/style.css | 28 |
2 files changed, 19 insertions, 55 deletions
diff --git a/plugins/sonar-core-plugin/src/main/resources/org/sonar/plugins/core/widgets/time_machine.html.erb b/plugins/sonar-core-plugin/src/main/resources/org/sonar/plugins/core/widgets/time_machine.html.erb index e4244e0c700..2f9830e54f9 100644 --- a/plugins/sonar-core-plugin/src/main/resources/org/sonar/plugins/core/widgets/time_machine.html.erb +++ b/plugins/sonar-core-plugin/src/main/resources/org/sonar/plugins/core/widgets/time_machine.html.erb @@ -31,7 +31,6 @@ snapshot_by_id[s.id]=s end rows_by_metric_id={} - rows=[] measures.each do |measure| next unless measure.metric @@ -39,7 +38,6 @@ row=rows_by_metric_id[measure.metric_id] unless row row=Sonar::TimemachineRow.new(measure.metric) - rows<<row rows_by_metric_id[measure.metric_id]=row end @@ -49,32 +47,29 @@ end end - domains = [] - rows.select{|row| row.metric.val_type != Metric::VALUE_TYPE_DISTRIB}.each do |row| - domains << row.domain + # Create the list of rows to display in the same order as defined by the user + rows=[] + metric_ids.each do |metric_id| + row = rows_by_metric_id[metric_id] + if row + rows<<row + end end - display_domains = domains.uniq.size > 1 - - rows.sort! %> <div class="widget-matrix"> -<table class="widget-matrix"> +<table class="data"> <thead> <tr> - <th valign="top" nowrap="nowrap" style="background-color: #FFFFFF; border: 0px;"> - </th> + <th> </th> <% snapshots.each do |snapshot| %> - <th nowrap="nowrap" align="right" valign="top"> - <%= l snapshot.created_at.to_date %> + <th nowrap="nowrap"> + <%= l snapshot.created_at.to_date -%> <br/> - <% snapshot.user_events.each do |event| %> - <b><%= event.name %></b> - <br/> - <% end %> - </th> + <%= snapshot.event('Version').name -%> + </th> <% end %> <% if displaySparkLine %> <th> </th> @@ -84,26 +79,17 @@ <tbody> <% - previous_domain='' rows.select{|row| row.metric.val_type != Metric::VALUE_TYPE_DISTRIB}.each do |row| - if display_domains && previous_domain != row.domain - %> - <tr> - <td class="title" colspan="<%= snapshots.size + (displaySparkLine ? 2 : 1) -%>"><%= row.domain %></td> - </tr> - <% - end - previous_domain = row.domain %> - <tr class="<%= cycle("even", "odd", :name => row.domain) -%>"> - <td width="1%" nowrap="nowrap" valign="top"> + <tr class="<%= cycle 'even','odd' -%>"> + <td width="1%" nowrap="nowrap" class="left text"> <%= row.metric.short_name %> </td> <% snapshots.each do |snapshot| measure=row.measure(snapshot) %> - <td align="right" width="1%" nowrap="nowrap"><%= format_measure(measure, :skip_span_id => true) %></td> + <td width="1%" nowrap="nowrap" class="right"><%= format_measure(measure, :skip_span_id => true) %></td> <% end %> <% sparkline_url=row.sparkline_url diff --git a/sonar-server/src/main/webapp/stylesheets/style.css b/sonar-server/src/main/webapp/stylesheets/style.css index d606e23e264..6ebe3749880 100644 --- a/sonar-server/src/main/webapp/stylesheets/style.css +++ b/sonar-server/src/main/webapp/stylesheets/style.css @@ -1794,35 +1794,13 @@ table.matrix tbody td.title { div.widget-matrix { overflow:auto; -} - -table.widget-matrix { font-size: 12px; - margin: 1px; -} - -table.widget-matrix thead { - background-color: #CAE3F2; + padding: 1px; } -table.widget-matrix thead th { +div.widget-matrix th { text-align: right; - border: 1px solid #4b9fd5; - padding: 2px; - font-size: 11px; -} - -table.widget-matrix tbody td.title { - border: none; - font-weight: bold; - padding: 5px 0 0 0px; -} - -table.widget-matrix tbody td { - border: 1px solid #ddd; - margin: 0; - padding: 1px 2px 1px 10px; - vertical-align: middle; + font-weight: normal; } |