diff options
author | David Gageot <david@gageot.net> | 2012-10-10 16:30:12 +0200 |
---|---|---|
committer | David Gageot <david@gageot.net> | 2012-10-10 16:30:44 +0200 |
commit | c7b8f20840b92862d4c0c487390a6f8b6ecd2c48 (patch) | |
tree | f1040fb9c4a8b97717543b6d95e293daec05baad | |
parent | 14e81abf83cff0f76b7cc38131d7991f9afae0b3 (diff) | |
download | sonarqube-c7b8f20840b92862d4c0c487390a6f8b6ecd2c48.tar.gz sonarqube-c7b8f20840b92862d4c0c487390a6f8b6ecd2c48.zip |
Fix rule parameter descriptions
-rw-r--r-- | sonar-server/src/main/webapp/WEB-INF/app/models/rules_parameter.rb | 9 | ||||
-rw-r--r-- | sonar-server/src/main/webapp/WEB-INF/app/views/rules_configuration/_rule_param.html.erb | 2 |
2 files changed, 10 insertions, 1 deletions
diff --git a/sonar-server/src/main/webapp/WEB-INF/app/models/rules_parameter.rb b/sonar-server/src/main/webapp/WEB-INF/app/models/rules_parameter.rb index afee77ecbf4..05a5b2664cb 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/models/rules_parameter.rb +++ b/sonar-server/src/main/webapp/WEB-INF/app/models/rules_parameter.rb @@ -33,6 +33,15 @@ class RulesParameter < ActiveRecord::Base param_type[2, param_type.length-3].split(",") end + def description + @l10n_description ||= + begin + result = Java::OrgSonarServerUi::JRubyFacade.instance.getRuleParamDescription(I18n.locale, rule.repository_key, rule.plugin_rule_key, name) + result = read_attribute(:description) unless result + result + end + end + def description=(value) write_attribute(:description, value) end diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/rules_configuration/_rule_param.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/rules_configuration/_rule_param.html.erb index 7e35b07abd5..daba3972caf 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/views/rules_configuration/_rule_param.html.erb +++ b/sonar-server/src/main/webapp/WEB-INF/app/views/rules_configuration/_rule_param.html.erb @@ -40,7 +40,7 @@ <% end %> <% end %> - <div class="form-val-note"><%= h(parameter.rule.description || "") -%> <%= ('(' + readable_type(parameter.param_type) + ')') if !readable_type(parameter.param_type).empty? -%></div> + <div class="form-val-note"><%= h(parameter.description || "") -%> <%= ('(' + readable_type(parameter.param_type) + ')') if !readable_type(parameter.param_type).empty? -%></div> </form> </td> |