From a3ce2f91fb4c9fbc46417daa22cfb107e39ca8a5 Mon Sep 17 00:00:00 2001 From: Fabrice Bellingard Date: Tue, 20 Dec 2011 17:53:11 +0100 Subject: [PATCH] SONAR-2662 Improve the action plan widget --- .../widgets/actionPlans/action_plans.html.erb | 71 ++++++++++++++++--- .../resources/org/sonar/l10n/core.properties | 2 + 2 files changed, 64 insertions(+), 9 deletions(-) diff --git a/plugins/sonar-core-plugin/src/main/resources/org/sonar/plugins/core/widgets/actionPlans/action_plans.html.erb b/plugins/sonar-core-plugin/src/main/resources/org/sonar/plugins/core/widgets/actionPlans/action_plans.html.erb index e3788735a8d..e2041c65f75 100644 --- a/plugins/sonar-core-plugin/src/main/resources/org/sonar/plugins/core/widgets/actionPlans/action_plans.html.erb +++ b/plugins/sonar-core-plugin/src/main/resources/org/sonar/plugins/core/widgets/actionPlans/action_plans.html.erb @@ -1,25 +1,31 @@ <% if has_role?(:user, @project) - action_plans = ActionPlan.find(:all, :conditions => ['status= ? AND project_id=?', ActionPlan::STATUS_OPEN, @project.id], - :include => 'reviews', :order => 'dead_line ASC') + open_action_plans = ActionPlan.find(:all, :conditions => ['status= ? AND project_id=?', ActionPlan::STATUS_OPEN, @project.id], + :include => 'reviews', :order => 'dead_line ASC') + closed_action_plans = ActionPlan.find(:all, :conditions => ['status= ? AND project_id=?', ActionPlan::STATUS_CLOSED, @project.id], + :include => 'reviews', :order => 'dead_line ASC') div_id = "action-plan-widget-#{widget.id.to_s}" %>
+ <% if has_role?(:admin, @project) %>
<%= message('widgets.more') -%>
+ <% end %> +

<%= message('widget.action_plans.title') -%>

-<% if action_plans.size ==0 %> - <%= message('widget.action_plans.no_action_plan') -%> -<% else %>
+ +<% if open_action_plans.size ==0 %> + <%= message('widget.action_plans.no_action_plan') -%> +<% else %> @@ -28,11 +34,58 @@ <% - action_plans.each do |plan| + open_action_plans.each do |plan| %> - + + <% if plan.progress[:total]==0 %> + + <% else %> + + <% end %> + + <% + end + %> + +
<%= h(plan.name) -%><%= plan.dead_line ? plan.dead_line.strftime("%d %b %Y") : ' ' -%><%= plan.dead_line ? plan.dead_line.strftime("%d %b %Y") : ' ' -%><%= message('action_plans.no_reviews_linked_to_action_plan') -%> + <%= render :partial => 'action_plans/progress', :locals => {:action_plan => plan} -%> +
+<% end %> + +<% + unless closed_action_plans.size ==0 + table_id = "closed-action-plan-table-#{widget.id.to_s}" + link_id = "closed-action-plan-link-#{widget.id.to_s}" +%> + +
<%= message('widget.action_plans.show_closed_action_plans') -%>
+ + + + + + + + <% + closed_action_plans.each do |plan| + %> + + + <% if plan.progress[:total]==0 %> <% else %> @@ -46,8 +99,8 @@ %> -
- <% end %> + + <% end %> 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 7447f77ef66..aba492ff7fe 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 @@ -663,6 +663,8 @@ widget.action_plans.name=Action plans widget.action_plans.description=Shows all the open action plans of the project widget.action_plans.title=Open action plans widget.action_plans.no_action_plan=No action plan +widget.action_plans.show_closed_action_plans=Show closed action plans +widget.action_plans.hide_closed_action_plans=Hide closed action plans widget.planned_reviews.name=Planned reviews widget.planned_reviews.description=Shows all the planned reviews of the project, gathered by action plan -- 2.39.5