From f1e00ac2b15e46588f33b3f7fbd9530e6dfd8804 Mon Sep 17 00:00:00 2001 From: Simon Brandhof Date: Mon, 13 Feb 2012 16:31:49 +0100 Subject: [PATCH] Rename ACTION_PLANS.DEAD_LINE to DEADLINE --- .../core/widgets/actionPlans/action_plans.html.erb | 4 ++-- .../core/widgets/reviews/planned_reviews.html.erb | 2 +- .../app/controllers/action_plans_controller.rb | 12 ++++++------ .../main/webapp/WEB-INF/app/models/action_plan.rb | 2 +- .../WEB-INF/app/views/action_plans/_new.html.erb | 2 +- .../WEB-INF/app/views/action_plans/index.html.erb | 4 ++-- 6 files changed, 13 insertions(+), 13 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 301583d8b5d..208641dca2b 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,7 +1,7 @@ <% if has_role?(:user, @project) open_action_plans = ActionPlan.find(:all, :conditions => ['status= ? AND project_id=?', ActionPlan::STATUS_OPEN, @project.id], - :include => 'reviews', :order => 'dead_line ASC') + :include => 'reviews', :order => 'deadline ASC') div_id = "action-plan-widget-#{widget.id.to_s}" %> @@ -36,7 +36,7 @@ %> <%= h(plan.name) -%> - <%= plan.dead_line ? plan.dead_line.strftime("%d %b %Y") : ' ' -%> + <%= plan.deadline ? plan.deadline.strftime("%d %b %Y") : ' ' -%> <% if plan.progress[:total]==0 %> <%= message('action_plans.no_reviews_linked_to_action_plan') -%> <% else %> diff --git a/plugins/sonar-core-plugin/src/main/resources/org/sonar/plugins/core/widgets/reviews/planned_reviews.html.erb b/plugins/sonar-core-plugin/src/main/resources/org/sonar/plugins/core/widgets/reviews/planned_reviews.html.erb index cbb0a088b0b..f09cff1e970 100644 --- a/plugins/sonar-core-plugin/src/main/resources/org/sonar/plugins/core/widgets/reviews/planned_reviews.html.erb +++ b/plugins/sonar-core-plugin/src/main/resources/org/sonar/plugins/core/widgets/reviews/planned_reviews.html.erb @@ -14,7 +14,7 @@ title = message('widget.planned_reviews.name') open_action_plans = ActionPlan.find(:all, :conditions => ['status= ? AND project_id=?', ActionPlan::STATUS_OPEN, @project.id], - :include => 'reviews', :order => 'dead_line ASC') + :include => 'reviews', :order => 'deadline ASC') if open_action_plans.empty? %> diff --git a/sonar-server/src/main/webapp/WEB-INF/app/controllers/action_plans_controller.rb b/sonar-server/src/main/webapp/WEB-INF/app/controllers/action_plans_controller.rb index a34905e1662..347dab1c608 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/controllers/action_plans_controller.rb +++ b/sonar-server/src/main/webapp/WEB-INF/app/controllers/action_plans_controller.rb @@ -44,12 +44,12 @@ class ActionPlansController < ApplicationController @action_plan.name = params[:name] @action_plan.description = params[:description] - unless params[:dead_line].blank? + unless params[:deadline].blank? begin - dead_line = DateTime.strptime(params[:dead_line], '%d/%m/%Y') + deadline = DateTime.strptime(params[:deadline], '%d/%m/%Y') # we check if the date is today or in the future - if dead_line > 1.day.ago - @action_plan.dead_line = dead_line + if deadline > 1.day.ago + @action_plan.deadline = deadline else date_not_valid = message('action_plans.date_cant_be_in_past') end @@ -93,8 +93,8 @@ class ActionPlansController < ApplicationController end def load_action_plans - @open_action_plans = ActionPlan.find(:all, :conditions => ['status=? AND project_id=?', ActionPlan::STATUS_OPEN, @resource.id], :include => 'reviews', :order => 'dead_line ASC') - @closed_action_plans = ActionPlan.find(:all, :conditions => ['status=? AND project_id=?', ActionPlan::STATUS_CLOSED, @resource.id], :include => 'reviews', :order => 'dead_line DESC') + @open_action_plans = ActionPlan.find(:all, :conditions => ['status=? AND project_id=?', ActionPlan::STATUS_OPEN, @resource.id], :include => 'reviews', :order => 'deadline ASC') + @closed_action_plans = ActionPlan.find(:all, :conditions => ['status=? AND project_id=?', ActionPlan::STATUS_CLOSED, @resource.id], :include => 'reviews', :order => 'deadline DESC') end end diff --git a/sonar-server/src/main/webapp/WEB-INF/app/models/action_plan.rb b/sonar-server/src/main/webapp/WEB-INF/app/models/action_plan.rb index ebec35e6847..4c532642ce8 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/models/action_plan.rb +++ b/sonar-server/src/main/webapp/WEB-INF/app/models/action_plan.rb @@ -62,7 +62,7 @@ class ActionPlan < ActiveRecord::Base end def over_due? - dead_line ? status==STATUS_OPEN && dead_line.past? : false + deadline ? status==STATUS_OPEN && deadline.past? : false end private diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/action_plans/_new.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/action_plans/_new.html.erb index 838e644b9fb..0f920221930 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/views/action_plans/_new.html.erb +++ b/sonar-server/src/main/webapp/WEB-INF/app/views/action_plans/_new.html.erb @@ -17,7 +17,7 @@ <%= message('action_plans.col.due_for') -%>:
- +
<%= message('action_plans.date_format_help') -%> diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/action_plans/index.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/action_plans/index.html.erb index 5a6b01575fe..9b3dc1dbc51 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/views/action_plans/index.html.erb +++ b/sonar-server/src/main/webapp/WEB-INF/app/views/action_plans/index.html.erb @@ -26,7 +26,7 @@ <%= h(plan.name) -%> - <%= plan.dead_line ? plan.dead_line.strftime("%d %b %Y") : ' ' -%> + <%= plan.deadline ? plan.deadline.strftime("%d %b %Y") : ' ' -%> <% if plan.progress[:total]==0 %> <%= message('action_plans.no_reviews_linked_to_action_plan') -%> @@ -83,7 +83,7 @@ <%= h(plan.name) -%> - <%= plan.dead_line ? plan.dead_line.strftime("%d %b %Y") : ' ' -%> + <%= plan.deadline ? plan.deadline.strftime("%d %b %Y") : ' ' -%> <%= plan.updated_at.strftime("%d %b %Y") -%> <% if plan.progress[:total]==0 %> -- 2.39.5