diff options
author | Evgeny Mandrikov <mandrikov@gmail.com> | 2011-05-27 04:22:42 +0400 |
---|---|---|
committer | Evgeny Mandrikov <mandrikov@gmail.com> | 2011-05-27 13:11:19 +0400 |
commit | c073a325c80ef5d4c0d805b2545dd6be40b1892e (patch) | |
tree | e9b4915d8a196bda3163a2cabe6f3fc8b8b956c9 | |
parent | 1f2c4ac2e8dba121e095cd1d8a6f6865c7da0ff1 (diff) | |
download | sonarqube-c073a325c80ef5d4c0d805b2545dd6be40b1892e.tar.gz sonarqube-c073a325c80ef5d4c0d805b2545dd6be40b1892e.zip |
SONAR-1922 Improve UI for profile changelog
* Reorder columns
* Use bold instead of italic to express parameter changes
* Show severity icons
* Lowercase action text and simplify code
-rw-r--r-- | sonar-server/src/main/webapp/WEB-INF/app/models/active_rule_change.rb | 8 | ||||
-rw-r--r-- | sonar-server/src/main/webapp/WEB-INF/app/views/profiles/changelog.html.erb | 46 |
2 files changed, 29 insertions, 25 deletions
diff --git a/sonar-server/src/main/webapp/WEB-INF/app/models/active_rule_change.rb b/sonar-server/src/main/webapp/WEB-INF/app/models/active_rule_change.rb index d52c149b6ea..b58f811538e 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/models/active_rule_change.rb +++ b/sonar-server/src/main/webapp/WEB-INF/app/models/active_rule_change.rb @@ -22,6 +22,14 @@ class ActiveRuleChange < ActiveRecord::Base belongs_to :rule has_many :active_rule_param_changes, :dependent => :destroy + def action_text + case enabled + when true then "enabled" + when false then "disabled" + when nil then "modified" + end + end + def old_severity_text Sonar::RulePriority.to_s old_severity end diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/profiles/changelog.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/profiles/changelog.html.erb index 6a616bfe06c..a46645b46fb 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/views/profiles/changelog.html.erb +++ b/sonar-server/src/main/webapp/WEB-INF/app/views/profiles/changelog.html.erb @@ -6,66 +6,62 @@ <table class="data width100"> <thead> <tr> - <th>Action</th> - <th>By</th> <th>Date</th> - <th>Rule name</th> + <th>User</th> + <th>Action</th> + <th>Rule</th> <th>Parameters</th> </tr> </thead> - <% current_version = -1 + <% current_version = -1 @changes.each do |change| %> <% if current_version != change.profile_version %> <tr> <td align="left" colspan="5"> - <div class="line-block"> - <h2>Version <%=change.profile_version%></h2> - </div> + <div class="line-block"> + <h2>Version <%=change.profile_version%></h2> + </div> </td> </tr> <% current_version = change.profile_version end - %> + %> <tr class="<%= cycle 'even', 'odd', :name => change.profile_version -%>"> - <td valign="top"><%=case change.enabled - when true then "Enabled" - when false then "Disabled" - when nil then "Modified" - end%></td> - <td valign="top"><%=change.user_login%></td> <td valign="top"><%=change.change_date.strftime("%Y-%m-%d %H:%M:%S")%></td> + <td valign="top"><%=change.user_login%></td> + <td valign="top"><%=change.action_text%></td> <td valign="top"><%=change.rule.name%></td> <td valign="top"> <% if change.old_severity if change.new_severity %> - Severity changed from <i><%= change.old_severity_text %></i> to + Severity changed from <%= image_tag "priority/#{change.old_severity_text}.png" %><b><%= change.old_severity_text %></b> to <% else %> - Severity was <i><%= change.old_severity_text %></i> + Severity was <%= image_tag "priority/#{change.old_severity_text}.png" %><b><%= change.old_severity_text %></b> <% end end %> - <% if change.new_severity + <% if change.new_severity if change.old_severity %> - <i><%= change.new_severity_text %></i> + <%= image_tag "priority/#{change.new_severity_text}.png" %><b><%= change.new_severity_text %></b> <% else %> - Severity set to <i><%= change.new_severity_text %></i> + Severity set to <%= image_tag "priority/#{change.new_severity_text}.png" %><b><%= change.new_severity_text %></b> <% end end %> <% if (change.old_severity or change.new_severity) and change.parameters.size > 0 %> <br/> <% end %> <% change.parameters.each do |param_change| %> - Parameter <i><%=param_change.name %></i> + Parameter <b><%=param_change.name %></b> <% if not param_change.old_value %> - set to <i><%= param_change.new_value %></i> - <% elsif not param_change.new_value + set to <b><%= param_change.new_value %></b> + <% elsif not param_change.new_value if change.enabled == false %> - was <i><%= param_change.old_value %></i> + was <b><%= param_change.old_value %></b> <% else %> - reset to default value (was <i><%= param_change.old_value %></i>) + reset to default value (was <b><%= param_change.old_value %></b>) <% end else %> - changed from <i><%= param_change.old_value %></i> to <i><%= param_change.new_value %></i> + changed from <b><%= param_change.old_value %></b> to <b><%= param_change.new_value %></b> <% end %> <%= "<br/>" unless param_change == change.parameters.last %> <% end%> |