rules_configuration.rule_parameters=Parameters
+#------------------------------------------------------------------------------
+#
+# RULES DOCUMENTATION PAGE
+#
+#------------------------------------------------------------------------------
+rules.description=Description
+rules.rule_activated_on_profile_x=Rule activated on profile "{0}"
+rules.parameters=Parameters:
+
+
#------------------------------------------------------------------------------
#
# EMAIL CONFIGURATION
@rule=Rule.find(key)
end
@page_title=@rule.name
+
+ if params[:resource_id]
+ resource = Project.find(params[:resource_id])
+ @profile = resource.root_project.profile
+ @active_rule = @profile.active_by_rule_id(@rule.id)
+ end
end
end
<img src="<%= ApplicationController.root_context -%>/images/sep12.png">
<span class="rulename">
- <a onclick="window.open(this.href,'rule','height=800,width=900,scrollbars=1,resizable=1');return false;" href="<%= url_for :controller => 'rules', :action => 'show', :id => violation.rule.key, :layout => 'false' -%>"><%= h(violation.rule.name) -%></a>
+ <a onclick="window.open(this.href,'rule','height=800,width=900,scrollbars=1,resizable=1');return false;" href="<%= url_for :controller => 'rules', :action => 'show', :id => violation.rule.key, :resource_id => @resource.id, :layout => 'false' -%>"><%= h(violation.rule.name) -%></a>
</span>
<img src="<%= ApplicationController.root_context -%>/images/sep12.png">
<h1><%= @rule.name %></h1>
<div class="subtitle">
Plugin: <%= @rule.plugin_name -%>
-Key: <%= @rule.plugin_rule_key %></div>
+Key: <%= @rule.plugin_rule_key %>
+</div>
+
<div class="doc">
+ <h2><%= message('rules.description') -%></h2>
<p><%= @rule.description %></p>
-</div>
\ No newline at end of file
+
+ <% if @rule.note %>
+ <p><%= sanitize(@rule.note.text) -%></p>
+ <% end %>
+
+ <% if @profile %>
+ <h2><%= message('rules.rule_activated_on_profile_x', :params => @profile.name) -%></h2>
+
+ <% if @active_rule %>
+ <p><%= sanitize(@active_rule.note.text) if @active_rule.note %></p>
+
+ <h3><%= message('rules.parameters') -%></h3>
+ <table>
+ <% @rule.parameters.each do |parameter|
+ active_parameter = @active_rule.active_param_by_param_id(parameter.id)
+ %>
+ <tbody>
+ <tr>
+ <td width="10%" nowrap class="left">
+ <%= parameter.name %>:
+ </td>
+ <td width="90%" nowrap class="left">
+ <%= active_parameter.value unless active_parameter.value.blank? -%>
+ </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td style="padding-bottom:5px;">
+ <span class="note" style="white-space: normal"><%= h parameter.description -%></span>
+ </td>
+ </tr>
+ </tbody>
+ <% end %>
+ </table>
+ <% end %>
+ <% end %>
+
+
+</div>
}
/* ------------------- DOCUMENTATION --------------------- */
+.doc {
+ margin: 0px 10px;
+}
+
+.doc h2 {
+ margin-top: 10px;
+}
+
.doc p {
margin: 10px 0;
}