diff --git a/app/assets/stylesheets/costs/costs_legacy.css b/app/assets/stylesheets/costs/costs_legacy.css index 6604512447..439d5e96c6 100644 --- a/app/assets/stylesheets/costs/costs_legacy.css +++ b/app/assets/stylesheets/costs/costs_legacy.css @@ -98,10 +98,6 @@ td.comment input { cursor: pointer; } -.budget-table--fieldset{ - margin: 8px 2px; -} - .cost_entry td{ vertical-align: top; padding: 6px 6px; diff --git a/app/controllers/cost_objects_controller.rb b/app/controllers/cost_objects_controller.rb index 81aaea2b60..5b6a0c94c1 100644 --- a/app/controllers/cost_objects_controller.rb +++ b/app/controllers/cost_objects_controller.rb @@ -129,7 +129,7 @@ class CostObjectsController < ApplicationController Attachment.attach_files(@cost_object, params[:attachments]) render_attachment_warning_if_needed(@cost_object) - flash[:notice] = l(:notice_successful_create) + flash[:notice] = t(:notice_successful_create) redirect_to(params[:continue] ? { action: 'new' } : { action: 'show', id: @cost_object }) return @@ -158,19 +158,19 @@ class CostObjectsController < ApplicationController Attachment.attach_files(@cost_object, params[:attachments]) render_attachment_warning_if_needed(@cost_object) - flash[:notice] = l(:notice_successful_update) + flash[:notice] = t(:notice_successful_update) redirect_to(params[:back_to] || { action: 'show', id: @cost_object }) else render action: 'edit' end rescue ActiveRecord::StaleObjectError # Optimistic locking exception - flash.now[:error] = l(:notice_locking_conflict) + flash.now[:error] = t(:notice_locking_conflict) end def destroy @cost_objects.each(&:destroy) - flash[:notice] = l(:notice_successful_delete) + flash[:notice] = t(:notice_successful_delete) redirect_to action: 'index', project_id: @project end diff --git a/app/controllers/cost_types_controller.rb b/app/controllers/cost_types_controller.rb index a7cefdfeb5..c0988ad16a 100644 --- a/app/controllers/cost_types_controller.rb +++ b/app/controllers/cost_types_controller.rb @@ -56,14 +56,14 @@ class CostTypesController < ApplicationController @cost_type.attributes = permitted_params.cost_type if @cost_type.save - flash[:notice] = l(:notice_successful_update) + flash[:notice] = t(:notice_successful_update) redirect_back_or_default(action: 'index') else render action: 'edit', layout: !request.xhr? end rescue ActiveRecord::StaleObjectError # Optimistic locking exception - flash.now[:error] = l(:notice_locking_conflict) + flash.now[:error] = t(:notice_locking_conflict) end def new @@ -78,7 +78,7 @@ class CostTypesController < ApplicationController @cost_type = CostType.new(permitted_params.cost_type) if @cost_type.save - flash[:notice] = l(:notice_successful_update) + flash[:notice] = t(:notice_successful_update) redirect_back_or_default(action: 'index') else @cost_type.rates.build(valid_from: Date.today) if @cost_type.rates.empty? @@ -86,7 +86,7 @@ class CostTypesController < ApplicationController end rescue ActiveRecord::StaleObjectError # Optimistic locking exception - flash.now[:error] = l(:notice_locking_conflict) + flash.now[:error] = t(:notice_locking_conflict) end def destroy @@ -94,7 +94,7 @@ class CostTypesController < ApplicationController @cost_type.default = false if @cost_type.save - flash[:notice] = l(:notice_successful_lock) + flash[:notice] = t(:notice_successful_lock) redirect_back_or_default(action: 'index') end @@ -105,7 +105,7 @@ class CostTypesController < ApplicationController @cost_type.default = false if @cost_type.save - flash[:notice] = l(:notice_successful_restore) + flash[:notice] = t(:notice_successful_restore) redirect_back_or_default(action: 'index') end @@ -122,11 +122,11 @@ class CostTypesController < ApplicationController rate.rate = clean_currency(params[:rate]) if rate.save - flash[:notice] = l(:notice_successful_update) + flash[:notice] = t(:notice_successful_update) redirect_to action: 'index' else # FIXME: Do some real error handling here - flash[:error] = l(:notice_something_wrong) + flash[:error] = t(:notice_something_wrong) redirect_to action: 'index' end end diff --git a/app/controllers/costlog_controller.rb b/app/controllers/costlog_controller.rb index e3aec77c0c..255661db77 100644 --- a/app/controllers/costlog_controller.rb +++ b/app/controllers/costlog_controller.rb @@ -96,7 +96,7 @@ class CostlogController < ApplicationController elsif @cost_entry.save - flash[:notice] = l(:notice_cost_logged_successfully) + flash[:notice] = t(:notice_cost_logged_successfully) redirect_back_or_default action: 'index', project_id: @cost_entry.project else @@ -113,7 +113,7 @@ class CostlogController < ApplicationController elsif @cost_entry.save - flash[:notice] = l(:notice_successful_update) + flash[:notice] = t(:notice_successful_update) redirect_back_or_default action: 'index', project_id: @cost_entry.project else @@ -126,7 +126,7 @@ class CostlogController < ApplicationController render_404 and return unless @cost_entry render_403 and return unless @cost_entry.editable_by?(User.current) @cost_entry.destroy - flash[:notice] = l(:notice_successful_delete) + flash[:notice] = t(:notice_successful_delete) if request.referer =~ /cost_reports/ redirect_to controller: '/cost_reports', action: :index diff --git a/app/controllers/hourly_rates_controller.rb b/app/controllers/hourly_rates_controller.rb index f6e1d41956..6f49d0b40d 100644 --- a/app/controllers/hourly_rates_controller.rb +++ b/app/controllers/hourly_rates_controller.rb @@ -89,7 +89,7 @@ class HourlyRatesController < ApplicationController end if @user.save - flash[:notice] = l(:notice_successful_update) + flash[:notice] = t(:notice_successful_update) if @project.nil? redirect_back_or_default(controller: 'users', action: 'edit', id: @user) else @@ -126,7 +126,7 @@ class HourlyRatesController < ApplicationController page.replace_html "rate_for_#{@user.id}", link_to(number_to_currency(rate.rate), action: 'edit', id: @user, project_id: @project) end else - flash[:notice] = l(:notice_successful_update) + flash[:notice] = t(:notice_successful_update) redirect_to action: 'index' end end diff --git a/app/helpers/cost_objects_helper.rb b/app/helpers/cost_objects_helper.rb index e53116ad86..0a876458b6 100644 --- a/app/helpers/cost_objects_helper.rb +++ b/app/helpers/cost_objects_helper.rb @@ -29,7 +29,7 @@ module CostObjectsHelper end def cost_objects_to_csv(cost_objects) - CSV.generate(col_sep: l(:general_csv_separator)) do |csv| + CSV.generate(col_sep: t(:general_csv_separator)) do |csv| # csv header fields headers = ['#', Project.model_name.human, diff --git a/app/helpers/costlog_helper.rb b/app/helpers/costlog_helper.rb index 9f560b570a..6ae9e20dec 100644 --- a/app/helpers/costlog_helper.rb +++ b/app/helpers/costlog_helper.rb @@ -22,7 +22,7 @@ module CostlogHelper def render_costlog_breadcrumb links = [] - links << link_to(l(:label_project_all), project_id: nil, work_package_id: nil) + links << link_to(t(:label_project_all), project_id: nil, work_package_id: nil) links << link_to(h(@project), project_id: @project, work_package_id: nil) if @project links << link_to_work_package(@work_package, subject: false) if @work_package breadcrumb links @@ -36,7 +36,7 @@ module CostlogHelper cost_types.sort end collection = [] - collection << ["--- #{l(:actionview_instancetag_blank_option)} ---", ''] unless cost_types.detect(&:is_default?) + collection << ["--- #{t(:actionview_instancetag_blank_option)} ---", ''] unless cost_types.detect(&:is_default?) cost_types.each do |t| collection << [t.name, t.id] end collection end @@ -65,7 +65,7 @@ module CostlogHelper return nil if value.nil? || value == '' value = value.strip - value.gsub!(l(:currency_delimiter), '') if value.include?(l(:currency_delimiter)) && value.include?(l(:currency_separator)) + value.gsub!(t(:currency_delimiter), '') if value.include?(t(:currency_delimiter)) && value.include?(t(:currency_separator)) value.gsub(',', '.') BigDecimal.new(value) end diff --git a/app/models/activity/cost_object_activity_provider.rb b/app/models/activity/cost_object_activity_provider.rb index e0e6e7eff4..f552570a7d 100644 --- a/app/models/activity/cost_object_activity_provider.rb +++ b/app/models/activity/cost_object_activity_provider.rb @@ -33,7 +33,7 @@ class Activity::CostObjectActivityProvider < Activity::BaseActivityProvider end def event_title(event, _activity) - "#{l(:label_cost_object)} ##{event['journable_id']}: #{event['cost_object_subject']}" + "#{I18n.t(:label_cost_object)} ##{event['journable_id']}: #{event['cost_object_subject']}" end def event_path(event, _activity) diff --git a/app/models/cost_object.rb b/app/models/cost_object.rb index e8c39f79ab..cc813f7505 100644 --- a/app/models/cost_object.rb +++ b/app/models/cost_object.rb @@ -34,7 +34,7 @@ class CostObject < ActiveRecord::Base acts_as_journalized acts_as_event type: 'cost-objects', - title: Proc.new { |o| "#{l(:label_cost_object)} ##{o.id}: #{o.subject}" }, + title: Proc.new { |o| "#{I18n.t(:label_cost_object)} ##{o.id}: #{o.subject}" }, url: Proc.new { |o| { controller: 'cost_objects', action: 'show', id: o.id } } validates_presence_of :subject, :project, :author, :kind, :fixed_date @@ -116,7 +116,7 @@ class CostObject < ActiveRecord::Base # Label of the current type for display in GUI. Virtual accessor that is overriden by subclasses. def type_label - l(:label_cost_object) + I18n.t(:label_cost_object) end # Amount of the budget spent. Expressed as as a percentage whole number diff --git a/app/models/fixed_cost_object.rb b/app/models/fixed_cost_object.rb index 934c2f9c24..85b4641094 100644 --- a/app/models/fixed_cost_object.rb +++ b/app/models/fixed_cost_object.rb @@ -20,6 +20,6 @@ class FixedCostObject < CostObject # Label of the current type for display in GUI. def type_label - l(:label_fixed_cost_object) + I18n.t(:label_fixed_cost_object) end end diff --git a/app/models/rate.rb b/app/models/rate.rb index 8561cd6fa6..6978b0d826 100644 --- a/app/models/rate.rb +++ b/app/models/rate.rb @@ -32,7 +32,7 @@ class Rate < ActiveRecord::Base def self.clean_currency(value) if value && value.is_a?(String) value = value.strip - value.gsub!(l(:currency_delimiter), '') if value.include?(l(:currency_delimiter)) && value.include?(l(:currency_separator)) + value.gsub!(I18n.t(:currency_delimiter), '') if value.include?(I18n.t(:currency_delimiter)) && value.include?(I18n.t(:currency_separator)) value.gsub(',', '.') else value diff --git a/app/models/variable_cost_object.rb b/app/models/variable_cost_object.rb index 78ae169da7..f3963954f1 100644 --- a/app/models/variable_cost_object.rb +++ b/app/models/variable_cost_object.rb @@ -48,7 +48,7 @@ class VariableCostObject < CostObject # Label of the current cost_object type for display in GUI. def type_label - l(:label_variable_cost_object) + I18n.t(:label_variable_cost_object) end def material_budget diff --git a/app/views/cost_objects/_edit.html.erb b/app/views/cost_objects/_edit.html.erb index 645457029f..6b6582dfb9 100644 --- a/app/views/cost_objects/_edit.html.erb +++ b/app/views/cost_objects/_edit.html.erb @@ -26,8 +26,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. :class => 'form'} do |f| %> <%= error_messages_for 'cost_object' %> <%= render :partial => 'form', :locals => {:f => f} %> -