diff options
Diffstat (limited to 'sonar-server')
8 files changed, 61 insertions, 9 deletions
diff --git a/sonar-server/src/main/webapp/WEB-INF/app/models/measure_filter_display_treemap.rb b/sonar-server/src/main/webapp/WEB-INF/app/models/measure_filter_display_treemap.rb index 4ae790d9307..5ca58e8c3ca 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/models/measure_filter_display_treemap.rb +++ b/sonar-server/src/main/webapp/WEB-INF/app/models/measure_filter_display_treemap.rb @@ -28,13 +28,13 @@ class MeasureFilterDisplayTreemap < MeasureFilterDisplay super(filter, options) @size_metric = Metric.by_key(@filter.criteria('tmSize')||'ncloc') - @color_metric = Metric.by_key(@filter.criteria('tmColor')||'violations_density') + @color_metric = Metric.by_key(@filter.criteria('tmColor')) @html_id = options[:html_id] @filter.metrics=([@size_metric, @color_metric].compact) @height = (@filter.criteria('tmHeight')||'600').to_i @id_count = 0 - filter.set_criteria_value('sort', "metric:#{@size_metric.key}") + filter.set_criteria_value('sort', "metric:#{@size_metric.key}") if @size_metric filter.set_criteria_value('asc', 'true') filter.pagination.per_page = 500 filter.pagination.page = 1 @@ -64,7 +64,7 @@ class MeasureFilterDisplayTreemap < MeasureFilterDisplay private def build_tree(node) - if @filter.results + if @filter.results && @size_metric @filter.results.each do |result| size_measure=result.measure(@size_metric) if size_measure diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/comparison/index.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/comparison/index.html.erb index 589eb1fb02f..a3dc044f302 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/views/comparison/index.html.erb +++ b/sonar-server/src/main/webapp/WEB-INF/app/views/comparison/index.html.erb @@ -116,7 +116,7 @@ <span class="note"><%= human_short_date s.created_at -%></span> <div style="width: 100%; text-align: center;"> - <a href="#" onclick="removeFromList(<%= index -%>, $j('#sids'))"><img src="<%= ApplicationController.root_context -%>/images/controls/cross.png" title="<%= message('comparison.remove_resource') -%>"/></a> + <a href="#" onclick="removeFromList(<%= index -%>, $j('#sids'))"><img src="<%= ApplicationController.root_context -%>/images/cross-gray.png" title="<%= message('comparison.remove_resource') -%>"/></a> </div> </td> <td class="thin" style="vertical-align: bottom;"> @@ -194,7 +194,7 @@ <% if index < last_index %> <a href="#" onclick="moveDown(<%= index -%>)"><img src="<%= ApplicationController.root_context -%>/images/controls/move_down.png" title="<%= message('comparison.move_down') -%>"/></a> <% end %> - <a href="#" onclick="removeFromList(<%= index -%>, $j('#metrics'))"><img src="<%= ApplicationController.root_context -%>/images/controls/cross.png" title="<%= message('comparison.remove_metric') -%>"/></a> + <a href="#" onclick="removeFromList(<%= index -%>, $j('#metrics'))"><img src="<%= ApplicationController.root_context -%>/images/cross-gray.png" title="<%= message('comparison.remove_metric') -%>"/></a> </div> </td> diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/measures/_display_list.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/measures/_display_list.html.erb index 54128af8d86..e97a0ad8b6e 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/views/measures/_display_list.html.erb +++ b/sonar-server/src/main/webapp/WEB-INF/app/views/measures/_display_list.html.erb @@ -63,10 +63,10 @@ %> <% if edit_mode %> - <table class="data width100 admin"> + <table class="spaced width100 admin"> <tr> <td> - <%= metric_select_tag 'metric', Metric.all.reject { |m| m.data? }, + <%= metric_select_tag 'metric', Metric.all.reject { |m| m.hidden || m.data? }, :html_id => 'select-metric', :allow_empty => true, :key_prefix => 'metric:', diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/measures/_display_treemap.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/measures/_display_treemap.html.erb index 9f9fce68896..36455b848fa 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/views/measures/_display_treemap.html.erb +++ b/sonar-server/src/main/webapp/WEB-INF/app/views/measures/_display_treemap.html.erb @@ -1,3 +1,50 @@ +<% if edit_mode %> + <table class="spaced width100 admin"> + <tr> + <td valign="top" class="thin nowrap"> + <span class="comments"><%= message('size') -%></span> + <br/> + <%= metric_select_tag 'tmSize', Metric.all.select { |m| m.treemap_size? }, + :html_id => 'select-tm-size', + :selected_key => @filter.display.size_metric.key -%> + </td> + <td valign="top" class="thin nowrap"> + <span class="comments"><%= message('color') -%></span> + <span id="tm-gradient" class="note"></span> + <br/> + <%= metric_select_tag 'tmColor', Metric.all.select { |m| m.treemap_color? }, + :html_id => 'select-tm-color', + :allow_empty => true, + :selected_key => (@filter.display.color_metric ? @filter.display.color_metric.key : nil) -%> + + <button id="update-treemap">Update</button> + </td> + <td class="right" valign="bottom"> + <a href="#" class="button" id="exit-edit">Done</a> + </td> + </tr> + </table> + <% content_for :script do %> + <script> + $j(document).ready(function () { + $j("#update-treemap").on("click", function (e) { + var url = removeUrlAttr(decodeURI(window.location.href), 'tmSize'); + url = removeUrlAttr(url, 'tmColor'); + url += '&tmSize=' + $j('#select-tm-size').val(); + var color = $j('#select-tm-color').val(); + if (color != null && color != '') { + url += '&tmColor=' + color; + } + window.location = url; + }); + $j("#exit-edit").on("click", function (e) { + window.location = removeUrlAttr(decodeURI(window.location.href), 'edit'); + }); + }); + </script> + <% end %> +<% end %> + <div class="treemap" style="width: 100%; height:<%= @filter.display.height %>px;"> <%= @filter.display.html -%> </div>
\ No newline at end of file diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/measures/_sidebar.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/measures/_sidebar.html.erb index 2d8b5a07a54..8625a0c55de 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/views/measures/_sidebar.html.erb +++ b/sonar-server/src/main/webapp/WEB-INF/app/views/measures/_sidebar.html.erb @@ -118,7 +118,7 @@ <%= check_box_tag 'onFavourites', 'true', @filter.criteria['onFavourites']=='true' -%> </li> - <% condition_metrics = Metric.all.select { |m| m.numeric? } %> + <% condition_metrics = Metric.all.select { |m| m.numeric? && !m.hidden } %> <% for i in 1..3 %> <li id="criteria-metric-<%= i -%>" style="<%= "display: none" if hidden_condition_indexes.include?(i) -%>"> <%= metric_select_tag "c#{i}_metric", condition_metrics, :allow_empty => true, :selected_key => @filter.criteria("c#{i}_metric"), :width => '100%', :placeholder => 'Metric' -%> diff --git a/sonar-server/src/main/webapp/images/cross-gray.png b/sonar-server/src/main/webapp/images/cross-gray.png Binary files differnew file mode 100644 index 00000000000..16ec36bae4c --- /dev/null +++ b/sonar-server/src/main/webapp/images/cross-gray.png diff --git a/sonar-server/src/main/webapp/stylesheets/layout.css b/sonar-server/src/main/webapp/stylesheets/layout.css index 240cbc0f254..30fae43d0db 100644 --- a/sonar-server/src/main/webapp/stylesheets/layout.css +++ b/sonar-server/src/main/webapp/stylesheets/layout.css @@ -265,6 +265,10 @@ ul.sidebar li.spacer { margin: 0; padding: 0; } +ul.sidebar select, ul.sidebar input { + font-size: 93%; +} + #logo { text-align: center; diff --git a/sonar-server/src/main/webapp/stylesheets/select2.css b/sonar-server/src/main/webapp/stylesheets/select2.css index 746c8993703..4b5d4efddca 100755 --- a/sonar-server/src/main/webapp/stylesheets/select2.css +++ b/sonar-server/src/main/webapp/stylesheets/select2.css @@ -48,9 +48,10 @@ Version: 3.2 Timestamp: Mon Sep 10 10:38:04 PDT 2012 white-space: nowrap; position: relative; - /* sonar: reduce height */ + /* sonar: reduce height and font-size */ height: 20px; line-height: 20px; + font-size: 93%; padding: 0 0 0 8px; color: #444; text-decoration: none; |