Add publishing prices phase to budget model, plus translation texts

This commit is contained in:
Bertocq
2018-01-10 01:10:57 +01:00
parent d8ceff1a53
commit 922318b978
3 changed files with 11 additions and 4 deletions

View File

@@ -3,9 +3,9 @@ class Budget < ActiveRecord::Base
include Measurable
include Sluggable
PHASES = %w(drafting accepting reviewing selecting valuating balloting
reviewing_ballots finished).freeze
ON_HOLD_PHASES = %w(reviewing valuating reviewing_ballots).freeze
PHASES = %w(drafting accepting reviewing selecting valuating publishing_prices
balloting reviewing_ballots finished).freeze
ON_HOLD_PHASES = %w(reviewing valuating publishing_prices reviewing_ballots).freeze
CURRENCY_SYMBOLS = %w(€ $ £ ¥).freeze
@@ -27,6 +27,7 @@ class Budget < ActiveRecord::Base
scope :reviewing, -> { where(phase: "reviewing") }
scope :selecting, -> { where(phase: "selecting") }
scope :valuating, -> { where(phase: "valuating") }
scope :publishing_prices, -> { where(phase: "publishing_prices") }
scope :balloting, -> { where(phase: "balloting") }
scope :reviewing_ballots, -> { where(phase: "reviewing_ballots") }
scope :finished, -> { where(phase: "finished") }
@@ -65,6 +66,10 @@ class Budget < ActiveRecord::Base
phase == "valuating"
end
def publishing_prices?
phase == "publishing_prices"
end
def balloting?
phase == "balloting"
end
@@ -120,7 +125,7 @@ class Budget < ActiveRecord::Base
case phase
when 'accepting', 'reviewing'
%w{random}
when 'balloting', 'reviewing_ballots'
when 'publishing_prices', 'balloting', 'reviewing_ballots'
%w{random price}
else
%w{random confidence_score}

View File

@@ -34,6 +34,7 @@ en:
reviewing: Reviewing projects
selecting: Selecting projects
valuating: Valuating projects
publishing_prices: Publishing projects prices
balloting: Balloting projects
reviewing_ballots: Reviewing Ballots
finished: Finished budget

View File

@@ -34,6 +34,7 @@ es:
reviewing: Revisión interna de proyectos
selecting: Fase de apoyos
valuating: Evaluación de proyectos
publishing_prices: Publicación de precios
balloting: Votación final
reviewing_ballots: Votación finalizada
finished: Resultados