aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-server/src/main/webapp/WEB-INF/app/views/rules
diff options
context:
space:
mode:
authorFabrice Bellingard <bellingard@gmail.com>2012-01-24 19:19:20 +0100
committerFabrice Bellingard <bellingard@gmail.com>2012-01-24 19:21:16 +0100
commitc339385ccf76ec26cf8db19df901cdfe59c712b8 (patch)
tree7ebae28ecfbcc6c9b01f57144c9042865f2d4c66 /sonar-server/src/main/webapp/WEB-INF/app/views/rules
parented409e8f0a53554aad46ac438b93b7adc02cc5d8 (diff)
downloadsonarqube-c339385ccf76ec26cf8db19df901cdfe59c712b8.tar.gz
sonarqube-c339385ccf76ec26cf8db19df901cdfe59c712b8.zip
SONAR-1492 Improve rule & active rule edition page
+ use markdown instead of HTML + improve rule doc page
Diffstat (limited to 'sonar-server/src/main/webapp/WEB-INF/app/views/rules')
-rw-r--r--sonar-server/src/main/webapp/WEB-INF/app/views/rules/show.html.erb44
1 files changed, 28 insertions, 16 deletions
diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/rules/show.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/rules/show.html.erb
index 1f9fb945606..4de01168813 100644
--- a/sonar-server/src/main/webapp/WEB-INF/app/views/rules/show.html.erb
+++ b/sonar-server/src/main/webapp/WEB-INF/app/views/rules/show.html.erb
@@ -1,26 +1,29 @@
<h1><%= @rule.name %></h1>
-<div class="subtitle">
-Plugin: <%= @rule.plugin_name -%>&nbsp;&nbsp;&nbsp;
-Key: <%= @rule.plugin_rule_key %>
-</div>
<div class="doc">
- <h2><%= message('rules.description') -%></h2>
- <p><%= @rule.description %></p>
+ <% if @rule.description.strip.start_with?('<p>') %>
+ <%= @rule.description %>
+ <% else %>
+ <p><%= @rule.description %></p>
+ <% end %>
- <% if @rule.note %>
- <p><%= sanitize(@rule.note.text) -%></p>
+ <% if @rule.note && !@rule.note.text.strip.blank? %>
+ <p><%= @rule.note.html_text -%></p>
<% end %>
- <% if @profile %>
- <h2><%= message('rules.rule_activated_on_profile_x', :params => @profile.name) -%></h2>
+ <% if @profile && @active_rule %>
+ <br/>
+ <b>
+ <a href="#" onclick="$('details').toggle();return false;"><%= message('rules.more_about_rule_on_profile_x', :params => @profile.name) %></a>
+ </b>
- <% if @active_rule %>
- <p><%= sanitize(@active_rule.note.text) if @active_rule.note %></p>
+ <div id="details" style="display: none">
+ <p><%= @active_rule.note.html_text if @active_rule.note %></p>
<% unless @rule.parameters.empty? %>
+ <br/>
<h3><%= message('rules.parameters') -%></h3>
- <table>
+ <table style="margin-left:7px">
<% @rule.parameters.each do |parameter|
active_parameter = @active_rule.active_param_by_param_id(parameter.id)
%>
@@ -30,7 +33,7 @@ Key: <%= @rule.plugin_rule_key %>
<%= parameter.name %>: &nbsp;
</td>
<td width="90%" nowrap class="left">
- <%= active_parameter.value unless active_parameter.value.blank? -%>
+ <%= active_parameter.value if active_parameter.value && !active_parameter.value.blank? -%>
</td>
</tr>
<tr>
@@ -43,8 +46,17 @@ Key: <%= @rule.plugin_rule_key %>
<% end %>
</table>
<% end %>
- <% end %>
+
+ <br/>
+ <h3><%= message('rules.identification') -%></h3>
+ <table style="margin-left:7px">
+ <tbody>
+ <tr><td style="padding-right:10px"><%= message('plugin') -%>:</td><td><%= @rule.plugin_name.capitalize %></td></tr>
+ <tr><td style="padding-right:10px"><%= message('key') -%>:</td><td><%= @rule.plugin_rule_key %></td></tr>
+ </tbody>
+ </table>
+ </div>
+
<% end %>
-
</div>