rules_configuration.x_rules_have_been_activated={0} rules have been activated.
rules_configuration.x_rules_have_been_deactivated={0} rules have been deactivated.
rules_configuration.extend_description=Extend description
+rules_configuration.edit_note=Edit note
rules_configuration.update_description=Update description
rules_configuration.add_note=Add note
rules_configuration.confirm_delete_note=Do you really want to delete this note?
-rules_configuration.rule_identification=Identification
-rules_configuration.rule_parameters=Parameters
rules_configuration.rule_inherited_from_profile_x=Rule inherited from profile "{0}"
rules_configuration.rule_overriding_from_profile_x=Rule overrides parent definition from profile "{0}"
rules_configuration.original_value=Original value
submit_active_note_update_button_id = "sanub_" + active_rule.id.to_s
%>
-<div id="<%= active_note_detail_div_id -%>" style="padding: 4px;<%= 'border: 1px solid #DDDDDD;' if note -%>">
+<div id="<%= active_note_detail_div_id -%>">
<% if note %>
- <h4>
- <%= image_tag("reviews/comment.png") -%>
- <b><%= note.user.name -%></b>
- (<%= distance_of_time_in_words_to_now(note.updated_at) -%>)
+ <blockquote class="spacer-bottom">
+ <cite>
+ <b><%= note.user.name -%></b> (<%= distance_of_time_in_words_to_now(note.updated_at) -%>)
<% if is_admin %>
<%= image_tag 'sep12.png' -%>
- <a href="#" id="<%= edit_active_note_link_id -%>"
+ <a href="#" id="<%= edit_active_note_link_id -%>" class="link-action spacer-right"
onclick="$('<%= active_note_detail_div_id -%>').hide();$('<%= active_note_form_div_id -%>').show();$('<%= active_note_textarea_id -%>').focus();return false;"><%= message('edit') %></a>
<%= link_to_remote message('delete'),
:url => {:action => 'delete_active_rule_note', :active_rule_id => active_rule.id },
:update => "active_rule_note_#{active_rule.id}",
- :confirm => message('rules_configuration.confirm_delete_note') -%>
+ :confirm => message('rules_configuration.confirm_delete_note'),
+ :html => {:class => 'link-action spacer-right'} -%>
<% end %>
- </h4>
+ </cite>
<p><%= note.html_text -%></p>
+ </blockquote>
<% elsif is_admin && !active_rule.rules_profile.provided? %>
- <input type="button" id="<%= add_active_note_button_id -%>" value="<%= message('rules_configuration.add_note') -%>"
- onclick="$('<%= active_note_form_div_id -%>').show();$('<%= active_note_detail_div_id -%>').hide();$('<%= active_note_textarea_id -%>').focus();">
+ <a href="#" onclick="$('<%= active_note_form_div_id -%>').show();$('<%= active_note_detail_div_id -%>').hide();$('<%= active_note_textarea_id -%>').focus(); return false;"
+ class="link-action spacer-right" id="<%= add_active_note_button_id -%>"><%= message('rules_configuration.add_note') -%></a>
<% end %>
</div>
</td>
<td valign="top" class="left">
- <%= link_to_function("#{h rule.name}", nil, :class => "") do |page|
+ <div class="h3"><%= link_to_function("#{h rule.name}", nil, :class => "") do |page|
page.toggle "desc_#{rule.id}"
end
- %>
+ %></div>
+
<div id="desc_<%= rule.id -%>" class="rule_detail" style="<%= 'display:none' unless rule.id.to_s == params[:rule_id] -%>">
<a name="rule<%= rule.id -%>"/>
- <table width="100%">
- <tbody>
- <tr>
- <td width="50%">
- <div id="rule_note_<%= rule.id -%>">
- <%= render :partial => 'rule_note', :locals => {:rule => rule, :is_admin => is_admin } %>
- </div>
- <% if active_rule %>
- <div id="active_rule_note_<%= active_rule.id -%>">
- <%= render :partial => 'active_rule_note', :locals => {:active_rule => active_rule, :is_admin => is_admin } %>
- </div>
- <% end %>
- </td>
- <td class="separator"></td>
- <td width="50%">
- <%
- ancestor_profile = profile.parent
- ancestor_active_rule = ancestor_profile.active_by_rule_id(rule.id) if ancestor_profile && active_rule && (active_rule.inherited? || active_rule.overrides?)
- if ancestor_active_rule
- ancestor_active_rule_link = link_to ancestor_profile.name, :controller => 'rules_configuration', :action => 'index',
+
+ <div class="spacer-top spacer-bottom" id="rule_note_<%= rule.id -%>">
+ <%= render :partial => 'rule_note', :locals => {:rule => rule, :is_admin => is_admin } %>
+ </div>
+
+ <%
+ ancestor_profile = profile.parent
+ ancestor_active_rule = ancestor_profile.active_by_rule_id(rule.id) if ancestor_profile && active_rule && (active_rule.inherited? || active_rule.overrides?)
+ if ancestor_active_rule || !rule.parameters.empty?
+ %>
+ <table width="100%" class="table-bordered background-gray spacer-bottom">
+ <%
+ if ancestor_active_rule
+ ancestor_active_rule_link = link_to ancestor_profile.name, :controller => 'rules_configuration', :action => 'index',
:id => ancestor_profile.id, :rule_id => rule.id, :anchor => 'rule' + rule.id.to_s
- %>
- <%= message( active_rule.inherited? ? 'rules_configuration.rule_inherited_from_profile_x' : 'rules_configuration.rule_overriding_from_profile_x',
- :params => ancestor_active_rule_link) -%>
- <% if ancestor_active_rule.priority != active_rule.priority %>
- <span class="note" style="font-weight: bold"> (<%= message('rules_configuration.original_severity') -%>: <%= ancestor_active_rule.priority_text -%>)</span>
- <% end %>
- <% if is_admin && active_rule.overrides? %>
- <br/>
- <%= button_to message('rules_configuration.revert_to_parent_definition'), :overwrite_params => {:action => 'revert_rule', :id => profile.id, :active_rule_id => active_rule.id} %><br/>
- <% end %>
- <% end %>
-
- <% unless rule.parameters.empty? %>
- <h3><%= message('rules_configuration.rule_parameters') -%></h3>
- <table style="margin-left:7px">
- <% rule.parameters.each do |parameter|
- active_parameter = active_rule.active_param_by_param_id(parameter.id) if active_rule
- %>
- <tbody id="param_<%= parameter.id -%>">
- <%= render :partial => 'rule_param', :object => nil,
- :locals => {:parameter => parameter, :active_parameter => active_parameter, :profile => profile, :rule => rule,
- :active_rule => active_rule, :ancestor_active_rule => ancestor_active_rule, :is_admin => is_admin } %>
- </tbody>
- <% end %>
- </table>
+ %>
+ <tr>
+ <td colspan="2" style="padding: 8px">
+ <%= message( active_rule.inherited? ? 'rules_configuration.rule_inherited_from_profile_x' : 'rules_configuration.rule_overriding_from_profile_x',
+ :params => ancestor_active_rule_link) -%>
+ <% if ancestor_active_rule.priority != active_rule.priority %>
+ <img src="<%= ApplicationController.root_context -%>/images/overrides.png" alt="Overrides parent definition" title="<%= message('rules_configuration.overrides_parent_definition') -%>" style="vertical-align: middle"/>
+ <span class="form-val-note" style="font-weight: bold"> <%= message('rules_configuration.original_severity') -%>: <%= ancestor_active_rule.priority_text -%></span>
<% end %>
-
- <h3><%= message('rules_configuration.rule_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>
- <% if is_admin %>
- <br/>
- <% if rule.template? %>
- <%= button_to message('rules_configuration.copy_rule'), {:action => 'new', :id => profile.id, :rule_id => rule.id}, :id => "copy-#{u rule.key}" %>
- <% end %>
- <% if rule.editable? %>
- <%= button_to message('rules_configuration.edit_rule'), :action => 'edit', :id => profile.id, :rule_id => rule.id %>
- <% end %>
+ <% if is_admin && active_rule.overrides? %>
+ <form action="<%= url_for :overwrite_params => {:action => 'revert_rule', :id => profile.id, :active_rule_id => active_rule.id} -%>" method="post" style="display: inline">
+ <input type="submit" value="<%= message('rules_configuration.revert_to_parent_definition') -%>">
+ </form>
<% end %>
</td>
</tr>
- </tbody>
- </table>
- </div>
+ <% end %>
+ <% unless rule.parameters.empty?
+ rule.parameters.each do |parameter|
+ active_parameter = active_rule.active_param_by_param_id(parameter.id) if active_rule
+ %>
+ <tr id="param_<%= parameter.id -%>">
+ <%= render :partial => 'rule_param', :object => nil,
+ :locals => {:parameter => parameter, :active_parameter => active_parameter, :profile => profile, :rule => rule,
+ :active_rule => active_rule, :ancestor_active_rule => ancestor_active_rule, :is_admin => is_admin } %>
+ </tr>
+ <%
+ end
+ end
+ %>
+ </table>
+ <% end %>
+
+ <% if active_rule %>
+ <div id="active_rule_note_<%= active_rule.id -%>">
+ <%= render :partial => 'active_rule_note', :locals => {:active_rule => active_rule, :is_admin => is_admin } %>
+ </div>
+ <% end %>
+
+ <% if is_admin %>
+ <br/>
+ <% if rule.template? %>
+ <%= link_to message('rules_configuration.copy_rule'), {:action => 'new', :id => profile.id, :rule_id => rule.id}, :id => "copy-#{u rule.key}", :class => 'link-action spacer-right' %>
+ <% end %>
+ <% if rule.editable? %>
+ <%= link_to message('rules_configuration.edit_rule'), {:action => 'edit', :id => profile.id, :rule_id => rule.id}, :class => 'link-action spacer-right' %>
+ <% end %>
+ <% end %>
+
+ <div style="height: 17px;line-height: 17px;font-size: 11px;">
+ <div style="float: left">
+ <span style="color: #888"><%= rule.plugin_name.capitalize %>:</span>
+ <span style="color: #888"><%= rule.plugin_rule_key %></span>
+ </div>
+ </div>
+
</td>
<script type="text/javascript">
<% end %>
<% if is_admin %>
- <p style="text-align: right; font-style: italic;">
- ยป <a href="#" id="<%= note_extend_link_id -%>"
+ <div>
+ <a href="#" id="<%= note_extend_link_id -%>" class="link-action spacer-right"
onclick="$('<%= note_detail_div_id -%>').hide();$('<%= note_form_div_id -%>').show();$('<%= note_textarea_id -%>').focus();return false;"><%= message('rules_configuration.extend_description') %></a>
- </p>
+ </div>
<% end %>
</div>
active_rule_id = active_rule.id if active_rule
enable_modification = is_admin && !profile.provided?
%>
-<tr>
- <td width="10%" nowrap class="left">
- <%= parameter.name %>:
- </td>
- <td width="90%" nowrap class="left">
- <%= form_remote_tag :url => {:action => 'update_param', :id => active_param_id, :profile_id => profile.id, :param_id => parameter.id, :active_rule_id => active_rule_id},
- :update => "rule_#{rule.id}",
- :loading => "$('param_loading_#{parameter.id}').show();",
- :complete => "$('desc_#{rule.id}').show();" %>
- <% span_id = "text_#{parameter.id}" %>
- <% read_only = !active_rule || !enable_modification %>
- <% textfield = text_field_tag parameter.id, param_value, :size => parameter.input_box_size, :name => "value", :disabled => read_only %>
- <% textfield += link_to_function(image_tag("zoom.png"), "replaceTextField('#{span_id}', '#{parameter.id}')", :id => "toggle_text", :class => 'nolink') unless read_only %>
- <% textarea = text_area_tag parameter.id, param_value, :size => "100x10", :name => "value", :disabled => read_only %>
- <% textarea += "<br/>" %>
- <span id="<%= span_id %>"><%= (param_value.length < 50) ? textfield : textarea %></span>
+<td class="form-key-cell">
+ <%= parameter.name %>
+</td>
+<td class="form-val-cell">
+ <%= form_remote_tag :url => {:action => 'update_param', :id => active_param_id, :profile_id => profile.id, :param_id => parameter.id, :active_rule_id => active_rule_id},
+ :update => "rule_#{rule.id}",
+ :loading => "$('param_loading_#{parameter.id}').show();",
+ :complete => "$('desc_#{rule.id}').show();" %>
- <% if !read_only %>
- <%= submit_tag message('update_verb') %>
- <img src="<%= ApplicationController.root_context -%>/images/loading.gif" style="display:none;" id="param_loading_<%= parameter.id -%>">
- <% if active_parameter and active_parameter.errors.size>0 %>
- <span class="error"><%= active_parameter.errors.on 'value' %></span>
- <% end %>
- <% end %>
+ <% span_id = "text_#{parameter.id}" %>
+ <% read_only = !active_rule || !enable_modification %>
+ <% textfield = text_field_tag parameter.id, param_value, :size => parameter.input_box_size, :name => "value", :disabled => read_only %>
+ <% textfield += link_to_function(image_tag("zoom.png"), "replaceTextField('#{span_id}', '#{parameter.id}')", :id => "toggle_text", :class => 'nolink') unless read_only %>
+ <% textarea = text_area_tag parameter.id, param_value, :size => "100x10", :name => "value", :disabled => read_only %>
+ <% textarea += "<br/>" %>
+ <span id="<%= span_id %>"><%= (param_value.length < 50) ? textfield : textarea %></span>
+
+ <% if !read_only %>
+ <%= submit_tag message('update_verb') %>
+ <img src="<%= ApplicationController.root_context -%>/images/loading.gif" style="display:none;" id="param_loading_<%= parameter.id -%>">
+ <% if active_parameter and active_parameter.errors.size>0 %>
+ <span class="error"><%= active_parameter.errors.on 'value' %></span>
+ <% end %>
+ <% end %>
- <%
- if active_rule && active_rule.overrides? && ancestor_active_rule
- ancestor_param = ancestor_active_rule.active_param_by_param_id(parameter.id)
- ancestor_value = ancestor_param.value unless ancestor_param.value.blank?
+ <%
+ if active_rule && active_rule.overrides? && ancestor_active_rule
+ ancestor_param = ancestor_active_rule.active_param_by_param_id(parameter.id)
+ ancestor_value = ancestor_param.value unless ancestor_param.value.blank?
- if ancestor_value && ancestor_value != param_value
- %>
- <span class="note" style="font-weight: bold">
- (<%= message('rules_configuration.original_value') -%>: <%= ancestor_value -%>)
- </span>
- <%
- end
- end
- %>
- </form>
- </td>
-</tr>
-<tr>
- <td></td>
- <td style="padding-bottom:5px;">
- <span class="note" style="white-space: normal"><%= h parameter.description -%></span>
- </td>
-</tr>
+ if ancestor_value && ancestor_value != param_value
+ %>
+ <img src="<%= ApplicationController.root_context -%>/images/overrides.png" alt="Overrides parent definition" title="<%= message('rules_configuration.overrides_parent_definition') -%>" style="vertical-align: middle"/>
+ <span class="form-val-note" style="font-weight: bold; vertical-align: middle;">
+ <%= message('rules_configuration.original_value') -%>: <%= ancestor_value -%>
+ </span>
+ <%
+ end
+ end
+ %>
+ </form>
+
+ <% if parameter.description %>
+ <div class="form-val-note"><%= h parameter.description -%></div>
+ <% end %>
+</td>
@rules.each do |rule|
active_rule = @profile.active_by_rule_id(rule.id)
%>
- <tr id="rule_<%= rule.id -%>" class="<%= cycle('even','odd') -%>">
+ <tr id="rule_<%= rule.id -%>" class="<%= cycle('even','odd') -%> bordered-bottom">
<%= render :partial => 'rule', :object => rule, :locals => {:profile => @profile, :rule => rule, :active_rule => active_rule, :is_admin => is_admin} %>
</tr>
<% end %>
width: 100%;
}
-.rule_detail {
- color: #444;
- margin-top:10px;
-}
-
.rule_detail .markdown-help {
vertical-align:top;
width: 90px;
white-space: nowrap;
}
-.rule_detail > td > table {
- margin: 4px;
-}
-
-.rule_detail td {
- vertical-align: text-top;
-}
-
.rule_detail li {
list-style: disc outside;
padding: 2px;
padding-left: 30px;
}
-.rule_detail pre, .rule_detail p {
+.rule_detail pre {
padding: 7px;
}
font-size: 93%;
}
-.rule_detail .separator {
- background: url('../images/sep12.png') center repeat-y;
- min-width: 20px;
-}
-
.tip:hover {
background: #FFF;
position: relative;