note.text = params[:note]
note.user_login = current_user.login
note.save!
- render :partial => 'active_rule_note', :locals => {:active_rule => active_rule, :is_admin => true }
+ render :partial => 'active_rule_note', :locals => {:active_rule => active_rule, :is_admin => true, :profile => active_rule.rules_profile }
end
active_rule = ActiveRule.find(params[:active_rule_id])
active_rule.note.destroy if active_rule.note
active_rule.note = nil
- render :partial => 'active_rule_note', :locals => {:active_rule => active_rule, :is_admin => true }
+ render :partial => 'active_rule_note', :locals => {:active_rule => active_rule, :is_admin => true, :profile => active_rule.rules_profile }
end
end
def description
+ description(rule)
+ end
+
+ # We provide the rule as parameter to avoid reloading this rule_parameter's rule.
+ # This hack would be useless if we could use :inverse_of on :rule
+ def description(rule)
@l10n_description ||=
begin
result = Java::OrgSonarServerUi::JRubyFacade.getInstance().getRuleParamDescription(I18n.locale, rule.repository_key, rule.plugin_rule_key, name())
-<% #locals = active_rule, is_admin
+<% #locals = active_rule, is_admin, profile
note = active_rule.note
active_note_detail_div_id = "and_" + active_rule.id.to_s
add_active_note_button_id = "aanb_" + active_rule.id.to_s
</cite>
<p><%= note.html_text -%></p>
</blockquote>
- <% elsif is_admin && !active_rule.rules_profile.provided? %>
+ <% elsif is_admin && !profile.provided? %>
<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 %>
<% 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} %>
+ <%= render :partial => 'active_rule_note', :locals => {:active_rule => active_rule, :is_admin => is_admin, :profile => profile} %>
</div>
<% end %>
<% end %>
<% end %>
- <div class="form-val-note"><%= h(parameter.description || "") -%> <%= ('(' + readable_type(parameter.param_type) + ')') if !readable_type(parameter.param_type).empty? -%></div>
+ <div class="form-val-note"><%= h(parameter.description(rule) || "") -%> <%= ('(' + readable_type(parameter.param_type) + ')') if !readable_type(parameter.param_type).empty? -%></div>
</form>
</td>