diff options
author | Evgeny Mandrikov <mandrikov@gmail.com> | 2011-06-03 19:26:13 +0400 |
---|---|---|
committer | Evgeny Mandrikov <mandrikov@gmail.com> | 2011-06-08 14:23:15 +0400 |
commit | 2b5789abb824e5e834cbec911550f8678e2c563b (patch) | |
tree | 1e9f990da5e64ff433ab0bfd020620e9744de895 | |
parent | bf2fc86a6123ecffc559150db1c160e19dbea860 (diff) | |
download | sonarqube-2b5789abb824e5e834cbec911550f8678e2c563b.tar.gz sonarqube-2b5789abb824e5e834cbec911550f8678e2c563b.zip |
SONAR-1922 Improve UI for profile changelog
* Replace 'enabled' by 'on' and 'disabled' by 'off', fix typos.
* Use internationalized format for date.
* Add prefix 'last' to last version.
3 files changed, 9 insertions, 9 deletions
diff --git a/sonar-server/src/main/webapp/WEB-INF/app/controllers/profiles_controller.rb b/sonar-server/src/main/webapp/WEB-INF/app/controllers/profiles_controller.rb index 3d9cbeaf1ac..7cab30c34d5 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/controllers/profiles_controller.rb +++ b/sonar-server/src/main/webapp/WEB-INF/app/controllers/profiles_controller.rb @@ -225,7 +225,7 @@ class ProfilesController < ApplicationController end @changes = ActiveRuleChange.find(:all, :conditions => ['profile_id=? and ?<profile_version and profile_version<=?', @profile.id, @since_version, @to_version], :order => 'id desc') - @select_versions = versions.map {|u| ["version " + u.profile_version.to_s + " (" + u.change_date.strftime("%Y/%m/%d %H:%M:%S") + ")", u.profile_version]} | [["no version", 0]]; + @select_versions = versions.map {|u| [ (u.profile_version == last_version ? "last " : "" ) + "version " + u.profile_version.to_s + " (" + l(u.change_date) + ")", u.profile_version]} | [["no version", 0]]; end end 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 b58f811538e..218183b7839 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 @@ -24,8 +24,8 @@ class ActiveRuleChange < ActiveRecord::Base def action_text case enabled - when true then "enabled" - when false then "disabled" + when true then "on" + when false then "off" when nil then "modified" end 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 d1cfc1635c4..049de5a9a8d 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 @@ -8,9 +8,9 @@ <% form_tag({:action => 'changelog'}, {:method => 'post'}) do %> <%= hidden_field_tag "id", @profile.id %> - Cahngelog between + Changelog from <%= select_tag "since", options_for_select(@select_versions, @since_version) %> - and + to <%= select_tag "to", options_for_select(@select_versions, @to_version) %> <%= submit_tag "Load", :id => 'submit'%> <% end %> @@ -31,10 +31,10 @@ %> <tr class="<%= cycle('even', 'odd') -%>"> <td valign="top"><%= change.profile_version - 1 %> -> <%= change.profile_version %></td> - <td valign="top"><%=change.change_date.strftime("%Y-%m-%d %H:%M:%S")%></td> - <td valign="top"><%=change.user_name%></td> - <td valign="top"><%=change.action_text%></td> - <td valign="top"><%=change.rule.name%></td> + <td valign="top"><%= l(change.change_date) -%></td> + <td valign="top"><%= change.user_name %></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 %> |