diff options
Diffstat (limited to 'server/sonar-web')
3 files changed, 164 insertions, 164 deletions
diff --git a/server/sonar-web/src/main/hbs/design/design.hbs b/server/sonar-web/src/main/hbs/design/design.hbs index d8c86acbca7..39ec6432ee8 100644 --- a/server/sonar-web/src/main/hbs/design/design.hbs +++ b/server/sonar-web/src/main/hbs/design/design.hbs @@ -1,51 +1,49 @@ -<div class="page"> - <header class="page-header"> - <h1 class="page-title">{{t 'design.page'}}</h1> - <div class="page-actions"> - <i class="icon-help"></i> <a href="http://redirect.sonarsource.com/doc/dsm.html">{{t 'design.help'}}</a> - </div> - </header> +<header class="page-header"> + <h1 class="page-title">{{t 'design.page'}}</h1> + <div class="page-actions"> + <i class="icon-help"></i> <a href="http://redirect.sonarsource.com/doc/dsm.html">{{t 'design.help'}}</a> + </div> +</header> - <ul class="dsm-legend"> - <li> - <span class="dsm-legend-square gray"></span> - <span class="dsm-legend-label">{{t 'design.legend.dependencies'}}</span> - </li> - <li> - <span class="dsm-legend-square red"></span> - <span class="dsm-legend-label">{{t 'design.legend.cycles'}}</span> - </li> - <li> - <span class="dsm-legend-square green"></span> - <span class="dsm-legend-label">{{t 'design.legend.uses'}}</span> - <span class="dsm-legend-square blue"></span> - <span class="dsm-legend-label">{{t 'design.legend.uses'}}</span> - <span class="dsm-legend-square yellow"></span> - </li> - </ul> +<ul class="dsm-legend"> + <li> + <span class="dsm-legend-square gray"></span> + <span class="dsm-legend-label">{{t 'design.legend.dependencies'}}</span> + </li> + <li> + <span class="dsm-legend-square red"></span> + <span class="dsm-legend-label">{{t 'design.legend.cycles'}}</span> + </li> + <li> + <span class="dsm-legend-square green"></span> + <span class="dsm-legend-label">{{t 'design.legend.uses'}}</span> + <span class="dsm-legend-square blue"></span> + <span class="dsm-legend-label">{{t 'design.legend.uses'}}</span> + <span class="dsm-legend-square yellow"></span> + </li> +</ul> - <div class="dsm-body"> - <table> - <tbody> - {{#eachIndex items}} - <tr> - <td class="dsm-body-title" title="{{t 'design.rowTooltip'}}"> - {{qualifierIcon q}} {{n}} - {{#gt pt 0}} - <span class="dsm-body-title-package-tangles" title="{{t 'metric.package_cycles.name'}}">{{pt}}</span> - {{/gt}} - <span class="dsm-body-title-indicator"></span> +<div class="dsm-body"> + <table> + <tbody> + {{#eachIndex items}} + <tr> + <td class="dsm-body-title" title="{{t 'design.rowTooltip'}}"> + {{qualifierIcon q}} {{n}} + {{#gt pt 0}} + <span class="dsm-body-title-package-tangles" title="{{t 'metric.package_cycles.name'}}">{{pt}}</span> + {{/gt}} + <span class="dsm-body-title-indicator"></span> + </td> + {{#eachIndex v}} + <td class="dsm-body-cell {{#if status}}dsm-body-cell-{{status}}{{/if}}" title="{{t 'design.cellTooltip'}}"> + {{#eq index ../index}}–{{else}}{{w}}{{/eq}} </td> - {{#eachIndex v}} - <td class="dsm-body-cell {{#if status}}dsm-body-cell-{{status}}{{/if}}" title="{{t 'design.cellTooltip'}}"> - {{#eq index ../index}}–{{else}}{{w}}{{/eq}} - </td> - {{/eachIndex}} - </tr> - {{/eachIndex}} - </tbody> - </table> - </div> - - <div class="dsm-info"></div> + {{/eachIndex}} + </tr> + {{/eachIndex}} + </tbody> + </table> </div> + +<div class="dsm-info"></div> diff --git a/server/sonar-web/src/main/webapp/WEB-INF/app/views/design/index.html.erb b/server/sonar-web/src/main/webapp/WEB-INF/app/views/design/index.html.erb index 5a2d7843739..4a6972ac14c 100644 --- a/server/sonar-web/src/main/webapp/WEB-INF/app/views/design/index.html.erb +++ b/server/sonar-web/src/main/webapp/WEB-INF/app/views/design/index.html.erb @@ -6,6 +6,6 @@ <% end %> -<div id="project-design"> +<div id="project-design" class="page"> <i class="spinner"></i> </div> diff --git a/server/sonar-web/src/main/webapp/WEB-INF/app/views/drilldown/measures.html.erb b/server/sonar-web/src/main/webapp/WEB-INF/app/views/drilldown/measures.html.erb index b6f12ce75fa..eaf925d5c44 100644 --- a/server/sonar-web/src/main/webapp/WEB-INF/app/views/drilldown/measures.html.erb +++ b/server/sonar-web/src/main/webapp/WEB-INF/app/views/drilldown/measures.html.erb @@ -2,132 +2,134 @@ <script>require(['drilldown/app']);</script> <% end %> -<%= render :partial => 'header' -%> +<div class="page"> + <%= render :partial => 'header' -%> -<% if params[:period] && @snapshot.project_snapshot.periods? %> - <div id="snapshot_title" class="page_title"> - <h4> - <form method="GET" action="<%= url_for :action => 'measures' -%>" style="display: inline"> - <input type="hidden" name="metric" value="<%= params[:metric] -%>"/> + <% if params[:period] && @snapshot.project_snapshot.periods? %> + <div id="snapshot_title" class="page_title"> + <h4> + <form method="GET" action="<%= url_for :action => 'measures' -%>" style="display: inline"> + <input type="hidden" name="metric" value="<%= params[:metric] -%>"/> - <select id="select-comparison" name="period" onchange="submit()"> - <% if @drilldown.display_value? %> - <option value=""><%= message('time_changes') -%>...</option> - <% end %> - <% for period_index in 1..5 do %> - <%= period_select_options(@snapshot, period_index) if @drilldown.display_period?(period_index) -%> - <% end %> - </select> - <script> - $j(function() { - $j('#select-comparison').select2({ - width: '300px', - minimumResultsForSearch: 10, - dropdownCssClass: 'small' + <select id="select-comparison" name="period" onchange="submit()"> + <% if @drilldown.display_value? %> + <option value=""><%= message('time_changes') -%>...</option> + <% end %> + <% for period_index in 1..5 do %> + <%= period_select_options(@snapshot, period_index) if @drilldown.display_period?(period_index) -%> + <% end %> + </select> + <script> + $j(function() { + $j('#select-comparison').select2({ + width: '300px', + minimumResultsForSearch: 10, + dropdownCssClass: 'small' + }); }); - }); - </script> - </form> - </h4> - </div> -<% end %> + </script> + </form> + </h4> + </div> + <% end %> -<div class="marginbottom10"> - <% if @characteristic %> - <h3><%= @highlighted_metric.short_name -%> / <%= h(@characteristic.name(true)) -%></h3> + <div class="marginbottom10"> + <% if @characteristic %> + <h3><%= @highlighted_metric.short_name -%> / <%= h(@characteristic.name(true)) -%></h3> - <p class="big"><%= format_measure(@snapshot.characteristic_measure(@highlighted_metric, @characteristic)) %></p> - <% else %> - <h3><%= @highlighted_metric.short_name -%></h3> + <p class="big"><%= format_measure(@snapshot.characteristic_measure(@highlighted_metric, @characteristic)) %></p> + <% else %> + <h3><%= @highlighted_metric.short_name -%></h3> - <p class="big"> - <%= format_measure(@snapshot.measure(@highlighted_metric.key), :period => @period) %> - </p> - <% end %> - <% if @highlighted_metric!=@metric %> - <p> - <%= message('drilldown.drilldown_on') -%> - <b><%= format_measure(@metric.key, :period => @period) -%> <%= @metric.short_name -%></b> - </p> - <% end %> -</div> - -<div id="drilldown" class="width100"> - <% - rids=[] - first_column=true - last_column = nil - @drilldown.columns.each_with_index do |column, index| - %> - <% if first_column %> - <table class="width100 spacer-bottom"> - <tr> + <p class="big"> + <%= format_measure(@snapshot.measure(@highlighted_metric.key), :period => @period) %> + </p> <% end %> + <% if @highlighted_metric!=@metric %> + <p> + <%= message('drilldown.drilldown_on') -%> + <b><%= format_measure(@metric.key, :period => @period) -%> <%= @metric.short_name -%></b> + </p> + <% end %> + </div> - <td class="<%= 'spacer-left' unless first_column -%>" nowrap> - <div class="scrollable" id="col_<%= index -%>"> - <table class="spaced"> - <% column.measures.each_with_index do |measure, row_index| - resource=column.resource(measure) - selected = column.selected_snapshot && column.selected_snapshot.project_id==resource.id - clazz = cycle("even", "odd", :name => "col_#{index}") - clazz = clazz + ' selected' if selected - %> - <tr class="<%= clazz -%>" id="row_<%= index -%>_<%= row_index -%>"> - <td nowrap> - <% if resource.source_code? %> - <a href="<%= url_for :controller => 'dashboard', :action => 'index', :id => resource.id, :period => @period, :metric => (@metric && @metric.key), :rule => @rule ? @rule.id : @severity -%>" - onclick="window.open(this.href,'resource-<%= resource.key.parameterize -%>','scrollbars=1,resizable=1');return false;" - id="popup-<%= resource.key.parameterize -%>" class="nolink" - target="_blank"><i class="icon-detach" title="<%= message('new_window') -%>"></i></a> - <% else %> - <%= link_to(image_tag('zoom.png'), {:id => resource.id, :metric => @metric.id}, {:class => 'nolink'}) -%> - <% end %> - <%= qualifier_icon(resource) -%> - <% if resource.source_code? %> - <a href="#" title="<%= h resource.name(true) -%>" data-key="<%= resource.key -%>" - data-uuid="<%= resource.uuid -%>" class="js-drilldown-link"><%= h resource.name(false) %></a> - <% else %> - <%= link_to(h(resource.name), params.merge({:only_path => true, :rids => (selected ? rids-[resource.id] : rids+[resource.id])})) -%> - <% end %> - </td> - <td class="right"> - <%= format_measure(measure, :skip_span_id => true, :period => @period) -%> - </td> - </tr> - <% end %> - </table> - </div> - </td> - - <% if column.switch? || index==@drilldown.columns.size-1 %> - </tr> - </table> - <% end - first_column = column.switch? - rids<<column.selected_snapshot.project_id if column.selected_snapshot - last_column = column - end + <div id="drilldown" class="width100"> + <% + rids=[] + first_column=true + last_column = nil + @drilldown.columns.each_with_index do |column, index| %> - <% if last_column && @drilldown.selected_project_not_authorized %> - <p class="notes"><%= message('not_authorized_to_access_project', {:params => last_column.selected_snapshot.project.name}) -%></p> + <% if first_column %> + <table class="width100 spacer-bottom"> + <tr> + <% end %> + + <td class="<%= 'spacer-left' unless first_column -%>" nowrap> + <div class="scrollable" id="col_<%= index -%>"> + <table class="spaced"> + <% column.measures.each_with_index do |measure, row_index| + resource=column.resource(measure) + selected = column.selected_snapshot && column.selected_snapshot.project_id==resource.id + clazz = cycle("even", "odd", :name => "col_#{index}") + clazz = clazz + ' selected' if selected + %> + <tr class="<%= clazz -%>" id="row_<%= index -%>_<%= row_index -%>"> + <td nowrap> + <% if resource.source_code? %> + <a href="<%= url_for :controller => 'dashboard', :action => 'index', :id => resource.id, :period => @period, :metric => (@metric && @metric.key), :rule => @rule ? @rule.id : @severity -%>" + onclick="window.open(this.href,'resource-<%= resource.key.parameterize -%>','scrollbars=1,resizable=1');return false;" + id="popup-<%= resource.key.parameterize -%>" class="nolink" + target="_blank"><i class="icon-detach" title="<%= message('new_window') -%>"></i></a> + <% else %> + <%= link_to(image_tag('zoom.png'), {:id => resource.id, :metric => @metric.id}, {:class => 'nolink'}) -%> + <% end %> + <%= qualifier_icon(resource) -%> + <% if resource.source_code? %> + <a href="#" title="<%= h resource.name(true) -%>" data-key="<%= resource.key -%>" + data-uuid="<%= resource.uuid -%>" class="js-drilldown-link"><%= h resource.name(false) %></a> + <% else %> + <%= link_to(h(resource.name), params.merge({:only_path => true, :rids => (selected ? rids-[resource.id] : rids+[resource.id])})) -%> + <% end %> + </td> + <td class="right"> + <%= format_measure(measure, :skip_span_id => true, :period => @period) -%> + </td> + </tr> + <% end %> + </table> + </div> + </td> + + <% if column.switch? || index==@drilldown.columns.size-1 %> + </tr> + </table> + <% end + first_column = column.switch? + rids<<column.selected_snapshot.project_id if column.selected_snapshot + last_column = column + end + %> + <% if last_column && @drilldown.selected_project_not_authorized %> + <p class="notes"><%= message('not_authorized_to_access_project', {:params => last_column.selected_snapshot.project.name}) -%></p> + <% end %> + </div> + <script> + <% for i in 0...@drilldown.columns.size do %> + $j('#col_<%= i -%> tr.selected').each(function (index,item) { + item.scrollIntoView(true); + }); <% end %> -</div> -<script> - <% for i in 0...@drilldown.columns.size do %> - $j('#col_<%= i -%> tr.selected').each(function (index,item) { - item.scrollIntoView(true); - }); - <% end %> - window.drilldown = { - metric: <% if @metric %>'<%= @metric.key -%>'<% else %>null<% end %>, - rule: null, - severity: null, - period: <% if @period %>'<%= @snapshot.period_datetime(@period) -%>'<% else %>null<% end %> - }; -</script> + window.drilldown = { + metric: <% if @metric %>'<%= @metric.key -%>'<% else %>null<% end %>, + rule: null, + severity: null, + period: <% if @period %>'<%= @snapshot.period_datetime(@period) -%>'<% else %>null<% end %> + }; + </script> -<div id="source-viewer"></div> + <div id="source-viewer"></div> -<%= render :partial => 'footer' -%> + <%= render :partial => 'footer' -%> +</div> |