-<%= render :partial => 'resource/javascript', :locals => {:from => 'drilldown'} -%>
+<%= render :partial => 'resource/javascript' -%>
<%= 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] -%>" />
+ <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()" class="small">
- <% 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>
- </form>
- </h4>
-</div>
+ <select id="select-comparison" name="period" onchange="submit()" class="small">
+ <% 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>
+ </form>
+ </h4>
+ </div>
<% end %>
<div class="dashbox">
<% 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.measure(@highlighted_metric.key), :period => @period) %>
</p>
</div>
<!-- keep for IE6 ! -->
<table id="drilldown" class="width100" style="clear:left">
-<% if @highlighted_metric!=@metric %>
-<tr>
-<td colspan="<%= @drilldown.columns.size -%>"><%= message('drilldown.drilldown_on') -%> <b><%= format_measure(@metric.key, :period => @period) -%> <%= @metric.short_name -%></b></td>
-</tr>
-<tr>
-<% end
+ <% if @highlighted_metric!=@metric %>
+ <tr>
+ <td colspan="<%= @drilldown.columns.size -%>"><%= message('drilldown.drilldown_on') -%> <b><%= format_measure(@metric.key, :period => @period) -%> <%= @metric.short_name -%></b></td>
+ </tr>
+ <tr>
+ <% end
- rids=[]
- @drilldown.columns.each_with_index do |column, index|
-%>
-<td class="column <%= 'first' if index==0 -%>" nowrap>
- <div class="scrollable" id="col_<%= column.scope -%>">
- <table class="spaced">
- <% column.measures.each do |measure|
- resource=column.resource(measure)
- selected = column.selected_snapshot && column.selected_snapshot.project_id==resource.id
- clazz = cycle("even", "odd", :name => "col_#{column.scope}")
- clazz = clazz + ' selected' if selected
- %>
- <tr class="<%= clazz -%>">
- <td nowrap>
- <%
- if resource.entity?
- if resource.copy_resource_id %>
- <%= qualifier_icon(resource) -%>
- <%= link_to(resource.name, {:only_path => true, :overwrite_params => {:rids => nil, :id => resource.copy_resource_id}}) -%>
- <% else %>
- <%= qualifier_icon(resource) -%>
- <a href="#" onclick="d(<%= resource.id -%>)" alt="<%= resource.name(true) -%>" title="<%= resource.name(true) -%>"><%= resource.name(false) -%></a>
- <% end
- else %>
- <%= link_to(image_tag('zoom.png'), {:id => resource.id, :metric => @metric.id}, {:class => 'nolink'}) -%>
- <%= qualifier_icon(resource) -%>
- <%= link_to(resource.name, {:only_path => true, :overwrite_params => {:rids => (selected ? rids-[resource.id] : rids+[resource.id])}}) -%>
+ rids=[]
+ @drilldown.columns.each_with_index do |column, index|
+ %>
+ <td class="column <%= 'first' if index==0 -%>" nowrap>
+ <div class="scrollable" id="col_<%= column.scope -%>">
+ <table class="spaced">
+ <% column.measures.each do |measure|
+ resource=column.resource(measure)
+ selected = column.selected_snapshot && column.selected_snapshot.project_id==resource.id
+ clazz = cycle("even", "odd", :name => "col_#{column.scope}")
+ clazz = clazz + ' selected' if selected
+ %>
+ <tr class="<%= clazz -%>">
+ <td nowrap>
+ <%
+ if resource.entity?
+ if resource.copy_resource_id %>
+ <%= qualifier_icon(resource) -%>
+ <%= link_to(resource.name, {:only_path => true, :overwrite_params => {:rids => nil, :id => resource.copy_resource_id}}) -%>
+ <% else %>
+ <%= qualifier_icon(resource) -%>
+ <a href="#" onclick="d(<%= resource.id -%>)" alt="<%= resource.name(true) -%>" title="<%= resource.name(true) -%>"><%= resource.name(false) -%></a>
+ <% end
+ else %>
+ <%= link_to(image_tag('zoom.png'), {:id => resource.id, :metric => @metric.id}, {:class => 'nolink'}) -%>
+ <%= qualifier_icon(resource) -%>
+ <%= link_to(resource.name, {:only_path => true, :overwrite_params => {:rids => (selected ? rids-[resource.id] : rids+[resource.id])}}) -%>
+ <% end %>
+ </td>
+ <td class="right last">
+ <%= format_measure(measure, :skip_span_id => true, :period => @period) -%>
+ </td>
+ </tr>
<% end %>
- </td>
- <td class="right last" >
- <%= format_measure(measure, :skip_span_id => true, :period => @period) -%>
- </td>
- </tr>
- <% end %>
- </table>
- </div>
-</td>
-<%
- rids<<column.selected_snapshot.project_id if column.selected_snapshot
- end
-%>
-</tr>
+ </table>
+ </div>
+ </td>
+ <%
+ rids<<column.selected_snapshot.project_id if column.selected_snapshot
+ end
+ %>
+ </tr>
</table>
<script>
-<% @drilldown.columns.each do |column| %>
-$$('#col_<%= column.scope -%> tr.selected').each(function(item) {item.scrollIntoView(true);});
-<% end %>
+ <% @drilldown.columns.each do |column| %>
+ $$('#col_<%= column.scope -%> tr.selected').each(function (item) {
+ item.scrollIntoView(true);
+ });
+ <% end %>
</script>
<%= render :partial => 'footer' -%>
-<%= render :partial => 'resource/javascript', :locals => {:from => 'drilldown'} -%>
+<%= render :partial => 'resource/javascript' -%>
<%= render :partial => 'header' -%>
<div id="snapshot_title" class="page_title">
-<h4>
-<%
- profile_measure=@snapshot.measure(Metric::PROFILE)
- %>
-<% if profile_measure %>Profile <%= link_to profile_measure.data, :controller => '/rules_configuration', :action => 'index', :id => profile_measure.value.to_i %> - <% end %>
-<% if @snapshot.project_snapshot.periods? %>
-<form method="GET" action="<%= url_for :only_path=>true, :overwrite_params => {:period => nil} -%>" style="display: inline">
- <select id="select-comparison" name="period" onchange="submit()" class="small">
- <option value=""><%= message('time_changes') -%>...</option>
- <%= violation_period_select_options(@snapshot, 1) -%>
- <%= violation_period_select_options(@snapshot, 2) -%>
- <%= violation_period_select_options(@snapshot, 3) -%>
- <%= violation_period_select_options(@snapshot, 4) -%>
- <%= violation_period_select_options(@snapshot, 5) -%>
- </select>
- </form>
-<% end %>
-</h4>
+ <h4>
+ <%
+ profile_measure=@snapshot.measure(Metric::PROFILE)
+ %>
+ <% if profile_measure %>Profile <%= link_to profile_measure.data, :controller => '/rules_configuration', :action => 'index', :id => profile_measure.value.to_i %> -
+ <% end %>
+ <% if @snapshot.project_snapshot.periods? %>
+ <form method="GET" action="<%= url_for :only_path=>true, :overwrite_params => {:period => nil} -%>" style="display: inline">
+ <select id="select-comparison" name="period" onchange="submit()" class="small">
+ <option value=""><%= message('time_changes') -%>...</option>
+ <%= violation_period_select_options(@snapshot, 1) -%>
+ <%= violation_period_select_options(@snapshot, 2) -%>
+ <%= violation_period_select_options(@snapshot, 3) -%>
+ <%= violation_period_select_options(@snapshot, 4) -%>
+ <%= violation_period_select_options(@snapshot, 5) -%>
+ </select>
+ </form>
+ <% end %>
+ </h4>
</div>
<table width="100%" cellpadding="0" cellspacing="0" id="columns">
-<tr>
- <td align="left" width="1%" nowrap class="column first">
+ <tr>
+ <td align="left" width="1%" nowrap class="column first">
- <%
- value_column = (@period ? "variation_value_#{@period}" : 'value')
- max = 0
- if @period
- blocker_violations=@snapshot.measure('new_blocker_violations')
- critical_violations=@snapshot.measure('new_critical_violations')
- major_violations=@snapshot.measure('new_major_violations')
- minor_violations=@snapshot.measure('new_minor_violations')
- info_violations=@snapshot.measure('new_info_violations')
- else
- blocker_violations=@snapshot.measure('blocker_violations')
- critical_violations=@snapshot.measure('critical_violations')
- major_violations=@snapshot.measure('major_violations')
- minor_violations=@snapshot.measure('minor_violations')
- info_violations=@snapshot.measure('info_violations')
- end
+ <%
+ value_column = (@period ? "variation_value_#{@period}" : 'value')
+ max = 0
+ if @period
+ blocker_violations=@snapshot.measure('new_blocker_violations')
+ critical_violations=@snapshot.measure('new_critical_violations')
+ major_violations=@snapshot.measure('new_major_violations')
+ minor_violations=@snapshot.measure('new_minor_violations')
+ info_violations=@snapshot.measure('new_info_violations')
+ else
+ blocker_violations=@snapshot.measure('blocker_violations')
+ critical_violations=@snapshot.measure('critical_violations')
+ major_violations=@snapshot.measure('major_violations')
+ minor_violations=@snapshot.measure('minor_violations')
+ info_violations=@snapshot.measure('info_violations')
+ end
- [blocker_violations, critical_violations, major_violations, minor_violations, info_violations].each do |m|
- value = measure_or_variation_value(m)
- max = value if value && value>max
- end
- %>
- <h3><%= message('violations_drilldown.col.severity') -%></h3>
- <table class="spacedicon" style="border: 1px solid #ccc;">
- <%= render :partial => 'severity', :locals => {:css => 'even', :severity => 'BLOCKER', :max => max, :measure => blocker_violations }%>
- <%= render :partial => 'severity', :locals => {:css => 'odd', :severity => 'CRITICAL', :max => max, :measure => critical_violations }%>
- <%= render :partial => 'severity', :locals => {:css => 'even', :severity => 'MAJOR', :max => max, :measure => major_violations }%>
- <%= render :partial => 'severity', :locals => {:css => 'odd', :severity => 'MINOR', :max => max, :measure => minor_violations }%>
- <%= render :partial => 'severity', :locals => {:css => 'even', :severity => 'INFO', :max => max, :measure => info_violations }%>
- </table>
- </td>
- <td class="column" align="left" style="white-space: normal;">
- <h3><%= message('violations_drilldown.col.rule') -%></h3>
- <div class="scrollable">
- <table class="spacedicon" width="100%" id="col_rules">
- <%
- max=0
- rule_index=0
- already_selected=false
- @rule_measures.each do |m|
- value = m.send(value_column) if m
- max=value if value && value>max
- end
- @rule_measures.sort do|x,y|
- val=y.rule_priority<=>x.rule_priority
- if val==0
- x_value=x.send(value_column)
- y_value=y.send(value_column)
- y_value <=> x_value
- else
- val
- end
- end.each do |rule_measure|
- value = rule_measure.send(value_column)
- next if value.nil? || value==0
- rule=rule_measure.rule
- clazz = cycle('even', 'odd', :name => 'rules')
- selected = !already_selected && @rule && @rule.id==rule_measure.rule_id && (@rule_severity.nil? || @rule_severity==rule_measure.severity)
- already_selected = true if selected
- clazz = clazz + ' selected' if selected
- rule_index+=1
- %>
- <tr class="<%= clazz -%>">
- <td width="1%" nowrap>
- <a id="<%= "rule#{rule_index}" -%>" title="<%= message('violations_drilldown.click_for_more_on_x', :params => [rule.plugin_name, rule.plugin_rule_key]) -%>" onclick="window.open(this.href,'rule','height=800,width=900,scrollbars=1,resizable=1');return false;" href="<%= url_for :controller => 'rules', :action => 'show', :id => rule.key, :layout => 'false' -%>"><img src="<%= ApplicationController.root_context -%>/images/priority/<%= rule_measure.rule_priority -%>.png" /></a>
- </td>
- <td>
- <%= link_to(rule.name, {:rule => (selected ? nil : rule.key), :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}") -%>
- </td>
- <td class="right" nowrap="nowrap">
- <span><%= @period ? format_variation(rule_measure, :period => @period, :style => 'light') : rule_measure.formatted_value -%></span>
- </td>
- <td class="left last">
- <%= barchart(:width => 70, :percent => (100 * value / max).to_i, :color => (@period ? '#cc0000' : '#777')) if max>0 %>
- </td>
- </tr>
- <% end %>
+ [blocker_violations, critical_violations, major_violations, minor_violations, info_violations].each do |m|
+ value = measure_or_variation_value(m)
+ max = value if value && value>max
+ end
+ %>
+ <h3><%= message('violations_drilldown.col.severity') -%></h3>
+ <table class="spacedicon" style="border: 1px solid #ccc;">
+ <%= render :partial => 'severity', :locals => {:css => 'even', :severity => 'BLOCKER', :max => max, :measure => blocker_violations} %>
+ <%= render :partial => 'severity', :locals => {:css => 'odd', :severity => 'CRITICAL', :max => max, :measure => critical_violations} %>
+ <%= render :partial => 'severity', :locals => {:css => 'even', :severity => 'MAJOR', :max => max, :measure => major_violations} %>
+ <%= render :partial => 'severity', :locals => {:css => 'odd', :severity => 'MINOR', :max => max, :measure => minor_violations} %>
+ <%= render :partial => 'severity', :locals => {:css => 'even', :severity => 'INFO', :max => max, :measure => info_violations} %>
+ </table>
+ </td>
+ <td class="column" align="left" style="white-space: normal;">
+ <h3><%= message('violations_drilldown.col.rule') -%></h3>
- <% if rule_index==0 %>
- <tr class="even"><td><%= message('violations_drilldown.no_violations') -%></td></tr>
- <% end %>
- </table>
- </div>
-</td>
-</tr>
+ <div class="scrollable">
+ <table class="spacedicon" width="100%" id="col_rules">
+ <%
+ max=0
+ rule_index=0
+ already_selected=false
+ @rule_measures.each do |m|
+ value = m.send(value_column) if m
+ max=value if value && value>max
+ end
+ @rule_measures.sort do |x, y|
+ val=y.rule_priority<=>x.rule_priority
+ if val==0
+ x_value=x.send(value_column)
+ y_value=y.send(value_column)
+ y_value <=> x_value
+ else
+ val
+ end
+ end.each do |rule_measure|
+ value = rule_measure.send(value_column)
+ next if value.nil? || value==0
+ rule=rule_measure.rule
+ clazz = cycle('even', 'odd', :name => 'rules')
+ selected = !already_selected && @rule && @rule.id==rule_measure.rule_id && (@rule_severity.nil? || @rule_severity==rule_measure.severity)
+ already_selected = true if selected
+ clazz = clazz + ' selected' if selected
+ rule_index+=1
+ %>
+ <tr class="<%= clazz -%>">
+ <td width="1%" nowrap>
+ <a id="<%= "rule#{rule_index}" -%>" title="<%= message('violations_drilldown.click_for_more_on_x', :params => [rule.plugin_name, rule.plugin_rule_key]) -%>" onclick="window.open(this.href,'rule','height=800,width=900,scrollbars=1,resizable=1');return false;" href="<%= url_for :controller => 'rules', :action => 'show', :id => rule.key, :layout => 'false' -%>"><img src="<%= ApplicationController.root_context -%>/images/priority/<%= rule_measure.rule_priority -%>.png"/></a>
+ </td>
+ <td>
+ <%= link_to(rule.name, {:rule => (selected ? nil : rule.key), :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}") -%>
+ </td>
+ <td class="right" nowrap="nowrap">
+ <span><%= @period ? format_variation(rule_measure, :period => @period, :style => 'light') : rule_measure.formatted_value -%></span>
+ </td>
+ <td class="left last">
+ <%= barchart(:width => 70, :percent => (100 * value / max).to_i, :color => (@period ? '#cc0000' : '#777')) if max>0 %>
+ </td>
+ </tr>
+ <% end %>
+
+ <% if rule_index==0 %>
+ <tr class="even">
+ <td><%= message('violations_drilldown.no_violations') -%></td>
+ </tr>
+ <% end %>
+ </table>
+ </div>
+ </td>
+ </tr>
</table>
<br/>
<table width="100%">
-<tr>
-<%
- paths=[]
- rids=[]
- column_width=(100/@drilldown.columns.size).to_i if @drilldown.columns.size>0
- @drilldown.columns.each_with_index do |column, index|
-%><td class="column <%= 'first' if index==0 -%>" nowrap width="<%= column_width -%>%">
-<div class="scrollable" id="col_<%= column.scope -%>">
-<table class="spaced">
- <%
- column.measures.each do |measure|
- resource=column.resource(measure)
- clazz = cycle('even', 'odd', :name => "col_#{column.scope}")
- selected = column.selected_snapshot && column.selected_snapshot.project_id==resource.id
- if selected
- clazz += ' selected'
- paths << [h(resource.name), @selected_rids-[resource.id]]
- end
- %>
- <tr class="<%= clazz -%>">
- <td nowrap>
- <%
- if resource.entity?
- if resource.copy_resource_id %>
- <%= qualifier_icon(resource) -%>
- <%= link_to(h(resource.name), {:only_path => true, :overwrite_params => {:rids => nil, :id => resource.copy_resource_id}}) -%>
- <% else %>
- <%= qualifier_icon(resource) -%>
- <a href="#" onclick="d(<%= resource.id -%>, '<%= @period_index -%>', '<%= @rule ? @rule.key : @severity -%>');" alt="<%= resource.name(true) -%>" title="<%= resource.name(true) -%>"><%= resource.name(false) %></a>
- <%
- end
- else %>
- <%= link_to(image_tag('zoom.png'), {:id => resource.id}, {:class => 'nolink'}) %>
- <%= qualifier_icon(resource) %>
- <%= link_to(h(resource.name), {:only_path => true, :overwrite_params => {:rids => (selected ? rids-[resource.id] : rids+[resource.id])}}) -%>
- <% end %>
- </td>
- <td class="right last" nowrap>
- <%= @period ? format_variation(measure, :period => @period, :style => 'light') : measure.formatted_value -%>
- </td>
-</tr>
-<% end %>
-</table>
-</div>
-</td>
-<%
- rids<<column.selected_snapshot.project_id if column.selected_snapshot
- end %>
-</tr>
+ <tr>
+ <%
+ paths=[]
+ rids=[]
+ column_width=(100/@drilldown.columns.size).to_i if @drilldown.columns.size>0
+ @drilldown.columns.each_with_index do |column, index|
+ %>
+ <td class="column <%= 'first' if index==0 -%>" nowrap width="<%= column_width -%>%">
+ <div class="scrollable" id="col_<%= column.scope -%>">
+ <table class="spaced">
+ <%
+ column.measures.each do |measure|
+ resource=column.resource(measure)
+ clazz = cycle('even', 'odd', :name => "col_#{column.scope}")
+ selected = column.selected_snapshot && column.selected_snapshot.project_id==resource.id
+ if selected
+ clazz += ' selected'
+ paths << [h(resource.name), @selected_rids-[resource.id]]
+ end
+ %>
+ <tr class="<%= clazz -%>">
+ <td nowrap>
+ <%
+ if resource.entity?
+ if resource.copy_resource_id %>
+ <%= qualifier_icon(resource) -%>
+ <%= link_to(h(resource.name), {:only_path => true, :overwrite_params => {:rids => nil, :id => resource.copy_resource_id}}) -%>
+ <% else %>
+ <%= qualifier_icon(resource) -%>
+ <a href="#" onclick="d(<%= resource.id -%>, '<%= @period_index -%>', '<%= @rule ? @rule.key : @severity -%>');" alt="<%= resource.name(true) -%>" title="<%= resource.name(true) -%>"><%= resource.name(false) %></a>
+ <%
+ end
+ else %>
+ <%= link_to(image_tag('zoom.png'), {:id => resource.id}, {:class => 'nolink'}) %>
+ <%= qualifier_icon(resource) %>
+ <%= link_to(h(resource.name), {:only_path => true, :overwrite_params => {:rids => (selected ? rids-[resource.id] : rids+[resource.id])}}) -%>
+ <% end %>
+ </td>
+ <td class="right last" nowrap>
+ <%= @period ? format_variation(measure, :period => @period, :style => 'light') : measure.formatted_value -%>
+ </td>
+ </tr>
+ <% end %>
+ </table>
+ </div>
+ </td>
+ <%
+ rids<<column.selected_snapshot.project_id if column.selected_snapshot
+ end %>
+ </tr>
</table>
<script>
-$$('#col_rules tr.selected').each(function(item) {item.scrollIntoView(true);});
-<% @drilldown.columns.each do |column| %>
-$$('#col_<%= column.scope -%> tr.selected').each(function(item) {item.scrollIntoView(true);});
-<% end %>
+ $$('#col_rules tr.selected').each(function (item) {
+ item.scrollIntoView(true);
+ });
+ <% @drilldown.columns.each do |column| %>
+ $$('#col_<%= column.scope -%> tr.selected').each(function (item) {
+ item.scrollIntoView(true);
+ });
+ <% end %>
-<% if @drilldown.highlighted_resource %>
- d(<%= @drilldown.highlighted_resource.id -%>);
-<% end %>
+ <% if @drilldown.highlighted_resource %>
+ d(<%= @drilldown.highlighted_resource.id -%>);
+ <% end %>
</script>
-<tr id="createViolationForm<%= @line -%>">
- <% for index in 0...@colspan %>
- <td class="nothing"></td>
+<tr id="createViolationRow<%= @line -%>">
+ <% for index in 0...(params['gray_colspan'].to_i) %>
+ <td class="gray"></td>
+ <% end %>
+ <% for index in 0...(params['white_colspan'].to_i) %>
+ <td class="white"></td>
<% end %>
<td class="violations">
- <% form_remote_tag :url => "#{ApplicationController.root_context}/resource/create_violation", :failure => "$('errorViolationForm#{@line}').update(request.responseText);$('errorViolationForm#{@line}').show()" do -%>
- <input type="hidden" name="resource" value="<%= params[:resource] -%>">
- <input type="hidden" name="line" value="<%= @line -%>">
- <input type="hidden" name="from" value="<%= @from -%>">
+ <div id="createViolationCell<%= @line -%>">
+ <% form_remote_tag :url => "#{ApplicationController.root_context}/resource/create_violation",
+ :update => {:success => "createViolationCell#{@line}"},
+ :html => {:id => "createViolationForm#{@line}"},
+ :failure => "$('errorViolationForm#{@line}').update(request.responseText);$('errorViolationForm#{@line}').show()" do -%>
+ <input type="hidden" name="resource" value="<%= params[:resource] -%>">
+ <input type="hidden" name="line" value="<%= @line -%>">
+ <input type="hidden" name="gray_colspan" value="<%= params[:gray_colspan] -%>">
+ <input type="hidden" name="white_colspan" value="<%= params[:white_colspan] -%>">
- <div class="violation">
- <div class="vtitle">
- <select name="severity" class="withIcons">
- <% Severity::SEVERITIES.each do |severity| %>
- <option class="sev_<%= severity -%>" value="<%= severity -%>" <%= 'selected' if severity==Severity::MAJOR -%>><%= message("severity.#{severity}") -%></option>
- <% end %>
- </select>
-
- <img src="<%= ApplicationController.root_context -%>/images/sep12.png">
-
- <select id="select-rule-<%= @html_id -%>" name="rule" onkeyup="this.blur();this.focus();" onchange="if ($F(this)=='') {$('new_rule_<%= @html_id -%>').show()} else {$('new_rule_<%= @html_id -%>').hide()}">
- <option value=""><%= message('code_viewer.create_violation.new_rule') -%></option>
- <% unless @rules.empty? %>
- <optgroup label="<%= message('code_viewer.create_violation.rules') -%>">
- <% @rules.each do |rule| %>
- <option value="<%= rule.id -%>"><%= h rule.name -%></option>
- <% end %>
- </optgroup>
- <% end %>
- </select>
+ <div class="violation">
+ <div class="vtitle">
+ <select name="severity" class="withIcons">
+ <% Severity::SEVERITIES.each do |severity| %>
+ <option class="sev_<%= severity -%>" value="<%= severity -%>" <%= 'selected' if severity==Severity::MAJOR -%>><%= message("severity.#{severity}") -%></option>
+ <% end %>
+ </select>
+
+ <img src="<%= ApplicationController.root_context -%>/images/sep12.png">
+
+ <select id="select-rule-<%= @html_id -%>" name="rule" onkeyup="this.blur();this.focus();" onchange="if ($F(this)=='') {$('new_rule_<%= @html_id -%>').show()} else {$('new_rule_<%= @html_id -%>').hide()}">
+ <option value=""><%= message('code_viewer.create_violation.new_rule') -%></option>
+ <% unless @rules.empty? %>
+ <optgroup label="<%= message('code_viewer.create_violation.rules') -%>">
+ <% @rules.each do |rule| %>
+ <option value="<%= rule.id -%>"><%= h rule.name -%></option>
+ <% end %>
+ </optgroup>
+ <% end %>
+ </select>
- <input type="text" name="new_rule" size="50" id="new_rule_<%= @html_id -%>">
- </div>
+ <input type="text" name="new_rule" size="50" id="new_rule_<%= @html_id -%>">
+ </div>
+
+ <div class="discussionComment first">
+ <textarea rows="5" name="message" style="width: 100%"></textarea>
- <div class="discussionComment first">
- <textarea rows="5" name="message" style="width: 100%"></textarea>
- <div class="error" id="errorViolationForm<%= @line -%>" style="display: none"></div>
- <input type="submit" value="<%= message('code_viewer.create_violation.submit') -%>">
- <a href="#" onclick="return hVF(<%= @line -%>)"><%= message('cancel') -%></a>
+ <div class="error" id="errorViolationForm<%= @line -%>" style="display: none"></div>
+ <input type="submit" value="<%= message('code_viewer.create_violation.submit') -%>">
+ <a href="#" onclick="return hVF(<%= @line -%>)"><%= message('cancel') -%></a>
+ </div>
</div>
- </div>
- <% end %>
+ <% end %>
+ </div>
</td>
</tr>
<script type="text/javascript">