From 7dc0d68a5a3cab41afd5dc1c814a6ed4d4900666 Mon Sep 17 00:00:00 2001 From: Simon Brandhof Date: Wed, 22 May 2013 15:00:41 +0200 Subject: [PATCH] SONAR-4290 improve admin console --- .../resources/org/sonar/l10n/core.properties | 2 +- .../issues_action_plans_controller.rb | 2 +- .../views/issues_action_plans/index.html.erb | 19 +++++++------------ 3 files changed, 9 insertions(+), 14 deletions(-) diff --git a/plugins/sonar-core-plugin/src/main/resources/org/sonar/l10n/core.properties b/plugins/sonar-core-plugin/src/main/resources/org/sonar/l10n/core.properties index 138a4e1676a..6aee839865e 100644 --- a/plugins/sonar-core-plugin/src/main/resources/org/sonar/l10n/core.properties +++ b/plugins/sonar-core-plugin/src/main/resources/org/sonar/l10n/core.properties @@ -641,7 +641,7 @@ action_plans.resolved_reviews_x_percent=Resolved reviews - {0}% ({1} reviews) action_plans.open_reviews_x_percent=Open reviews - {0}% ({1} reviews) action_plans.reopen=Reopen action_plans.close=Close -action_plans.closed_action_plan=Closed action plans +action_plans.closed_action_plan=Closed Action Plans #------------------------------------------------------------------------------ diff --git a/sonar-server/src/main/webapp/WEB-INF/app/controllers/issues_action_plans_controller.rb b/sonar-server/src/main/webapp/WEB-INF/app/controllers/issues_action_plans_controller.rb index 6fda7363ac3..60ff6c00bf2 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/controllers/issues_action_plans_controller.rb +++ b/sonar-server/src/main/webapp/WEB-INF/app/controllers/issues_action_plans_controller.rb @@ -82,7 +82,7 @@ class IssuesActionPlansController < ApplicationController def load_action_plans action_plans = Internal.issues.findActionPlanStats(@resource.key) @open_action_plans = action_plans.select {|plan| plan.isOpen()} - @closed_action_plans = action_plans.select {|plan| !plan.isOpen()} + @closed_action_plans = action_plans.reject {|plan| plan.isOpen()} users = Api.users.find('logins' => (@open_action_plans + @closed_action_plans).collect {|action_plan| action_plan.userLogin()}.join(",")) @users = Hash[users.collect { |user| [user.login(), user.name()] }] end diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/issues_action_plans/index.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/issues_action_plans/index.html.erb index 5ee5c788a01..573de3ec5a0 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/views/issues_action_plans/index.html.erb +++ b/sonar-server/src/main/webapp/WEB-INF/app/views/issues_action_plans/index.html.erb @@ -22,12 +22,11 @@ <% end %> <% @open_action_plans.each do |plan| - deadline = Api::Utils.java_to_ruby_datetime(plan.deadLine()) if plan.deadLine() %> - + <%= h(plan.name()) -%> - <%= format_date(plan.deadLine(), :time_if_today => true) -%> + <%= format_date(plan.deadLine(), :time_if_today => true) -%> <% if plan.totalIssues()==0 %> <%= message('issues_action_plans.no_issues_linked_to_action_plan') -%> @@ -57,7 +56,6 @@ <% end %> - <% unless @closed_action_plans.empty? %>

@@ -79,14 +77,12 @@ <% @closed_action_plans.each do |plan| - deadline = Api::Utils.java_to_ruby_datetime(plan.deadLine()) if plan.deadLine() - updated_at = Api::Utils.java_to_ruby_datetime(plan.updatedAt()) %> - + <%= h(plan.name) -%> - <%= format_date(plan.deadLine()) -%> - <%= format_date(plan.updatedAt()) -%> + <%= format_date(plan.deadLine()) -%> + <%= format_date(plan.updatedAt()) -%> <% if plan.totalIssues()==0 %> <%= message('issues_action_plans.no_issues_linked_to_action_plan') -%> @@ -100,15 +96,14 @@ <%= h(@users[plan.userLogin()]) -%> <%= link_to message('issues_action_plans.reopen'), - {:action => 'change_status', :id => @resource.id, :plan_key => plan.key}, {:method => 'POST', :class => 'action'} -%> + {:action => 'change_status', :id => @resource.id, :plan_key => plan.key}, {:method => 'POST', :class => 'link-action'} -%>   - <%= link_to message('delete'), {:action => 'delete', :id => @resource.id, :plan_key => plan.key}, {:method => 'POST', :confirm => message('issues_action_plans.confirm_delete'), :class => 'action'} -%> + <%= link_to message('delete'), {:action => 'delete', :id => @resource.id, :plan_key => plan.key}, {:method => 'POST', :confirm => message('issues_action_plans.confirm_delete'), :class => 'link-action link-red'} -%> <% end %> - <% end %> -- 2.39.5