From 6ddac77971fe906af9738f53e485b554064e45ce Mon Sep 17 00:00:00 2001 From: Fabrice Bellingard Date: Mon, 30 Jan 2012 11:57:47 +0100 Subject: [PATCH] SONAR-3104 Improve the usability of the project 'History' - Add row highlighting - Reorder columns - Remove date duplication --- .../resources/org/sonar/l10n/core.properties | 1 + .../app/views/project/_edit_event.html.erb | 2 +- .../app/views/project/history.html.erb | 59 ++++++++++--------- 3 files changed, 33 insertions(+), 29 deletions(-) diff --git a/plugins/sonar-l10n-en-plugin/src/main/resources/org/sonar/l10n/core.properties b/plugins/sonar-l10n-en-plugin/src/main/resources/org/sonar/l10n/core.properties index 2bf9ab17650..4053171992c 100644 --- a/plugins/sonar-l10n-en-plugin/src/main/resources/org/sonar/l10n/core.properties +++ b/plugins/sonar-l10n-en-plugin/src/main/resources/org/sonar/l10n/core.properties @@ -850,6 +850,7 @@ manual_measures.pending_message=Pending measures are marked with orange box. The project_history.page_title=Handle events and delete quality snapshots from project history project_history.col.year=Year project_history.col.month=Month +project_history.col.day=Day project_history.col.time=Time project_history.col.events=Events project_history.col.action=Action diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/project/_edit_event.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/project/_edit_event.html.erb index e2da29e7f3c..8cdffc2dd0c 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/views/project/_edit_event.html.erb +++ b/sonar-server/src/main/webapp/WEB-INF/app/views/project/_edit_event.html.erb @@ -12,7 +12,7 @@ <%= f.text_field :name, :onkeyup => "if (this.value=='') $('event_#{@event.id}_submit').disabled='true'; else $('event_#{@event.id}_submit').disabled='';" -%> - <%= message('category') -%> (<%= link_to message('configure').downcase, {:controller=> 'event_categories', :action => 'index'}, :class => 'action' %>)
+ <%= message('category') -%>
<%= f.select(:category, @categories.collect {|c| [ message('event.category.' + c.name, :default => c.name), c.name ] }) %> diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/project/history.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/project/history.html.erb index fb110c974ba..10bbcc63772 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/views/project/history.html.erb +++ b/sonar-server/src/main/webapp/WEB-INF/app/views/project/history.html.erb @@ -7,12 +7,13 @@ <%= message('project_history.col.year') -%> <%= message('project_history.col.month') -%> - - + <%= message('project_history.col.day') -%> <%= message('project_history.col.time') -%> - <%= message('project_history.col.action') -%> <%= message('project_history.col.version') -%> <%= message('project_history.col.events') -%> + + + <%= message('project_history.col.action') -%> @@ -26,36 +27,15 @@ profile_event = snapshot.event(EventCategory::KEY_PROFILE) other_events = snapshot.events.select{|e| e.category!=EventCategory::KEY_VERSION && e.category!=EventCategory::KEY_ALERT && e.category!=EventCategory::KEY_PROFILE} %> - + <%= time.year unless time.year == current_year -%> <%= l(time, :format => '%B').capitalize unless time.month == current_month -%> - - <%= image_tag "event_alert.png", :alt => (message('project_history.col.alert') + ": " + alert_event.name + ". " + alert_event.description) if alert_event -%> - - - - <%= image_tag "event_profile.png", :alt => message('project_history.col.profile') + ": " + profile_event.description if profile_event -%> - - - <%= l time, :format => :long -%> - - - <% - cell_content = nil; - if snapshot.islast? - cell_content = "" + message('project_history.last_snapshot') + "" - else - cell_content = button_to( message('project_history.delete_snapshot'), - { :action => "delete_snapshot_history", :id => @project.id, :snapshot_id => snapshot.id }, - :class => 'action red-button', - :confirm => message('project_history.are_you_sure_delete_snapshot_x', :params => l(time, :format => :long)) ) - end - %> - <%= cell_content -%> - + <%= l(time, :format => '%d') -%> + + <%= l(time, :format => '%H:%M') -%> @@ -110,6 +90,29 @@
+ + + <%= image_tag "event_alert.png", :alt => (message('project_history.col.alert') + ": " + alert_event.name + ". " + alert_event.description) if alert_event -%> + + + + <%= image_tag "event_profile.png", :alt => message('project_history.col.profile') + ": " + profile_event.description if profile_event -%> + + + + <% + cell_content = nil; + if snapshot.islast? + cell_content = "" + message('project_history.last_snapshot') + "" + else + cell_content = button_to( message('project_history.delete_snapshot'), + { :action => "delete_snapshot_history", :id => @project.id, :snapshot_id => snapshot.id }, + :class => 'action red-button', + :confirm => message('project_history.are_you_sure_delete_snapshot_x', :params => l(time, :format => :long)) ) + end + %> + <%= cell_content -%> + <% current_year = time.year -- 2.39.5