diff --git a/app/assets/stylesheets/participation.scss b/app/assets/stylesheets/participation.scss index 2152e07a7..6db84ed6f 100644 --- a/app/assets/stylesheets/participation.scss +++ b/app/assets/stylesheets/participation.scss @@ -1239,7 +1239,8 @@ text-decoration: none; } - a { + a, + div { display: block; padding: $line-height / 2; diff --git a/app/helpers/budgets_helper.rb b/app/helpers/budgets_helper.rb index 8ace7ccfb..24dd935c2 100644 --- a/app/helpers/budgets_helper.rb +++ b/app/helpers/budgets_helper.rb @@ -1,5 +1,12 @@ module BudgetsHelper + def heading_name_and_price_html(heading, budget) + content_tag :div do + concat(heading.name + ' ') + concat(content_tag(:span, budget.formatted_heading_price(heading))) + end + end + def csv_params csv_params = params.clone.merge(format: :csv).symbolize_keys csv_params.delete(:page) diff --git a/app/models/budget.rb b/app/models/budget.rb index 8457ba1ac..28f37f4bc 100644 --- a/app/models/budget.rb +++ b/app/models/budget.rb @@ -21,6 +21,7 @@ class Budget < ActiveRecord::Base after_create :generate_phases scope :drafting, -> { where(phase: "drafting") } + scope :informing, -> { where(phase: "informing") } scope :accepting, -> { where(phase: "accepting") } scope :reviewing, -> { where(phase: "reviewing") } scope :selecting, -> { where(phase: "selecting") } @@ -64,6 +65,10 @@ class Budget < ActiveRecord::Base phase == "drafting" end + def informing? + phase == "informing" + end + def accepting? phase == "accepting" end diff --git a/app/models/budget/phase.rb b/app/models/budget/phase.rb index e625272d0..432c4b609 100644 --- a/app/models/budget/phase.rb +++ b/app/models/budget/phase.rb @@ -1,6 +1,6 @@ class Budget class Phase < ActiveRecord::Base - PHASE_KINDS = %w(drafting accepting reviewing selecting valuating publishing_prices balloting + PHASE_KINDS = %w(drafting informing accepting reviewing selecting valuating publishing_prices balloting reviewing_ballots finished).freeze PUBLISHED_PRICES_PHASES = %w(publishing_prices balloting reviewing_ballots finished).freeze SUMMARY_MAX_LENGTH = 1000 @@ -26,6 +26,7 @@ class Budget scope :enabled, -> { where(enabled: true) } scope :published, -> { enabled.where.not(kind: 'drafting') } scope :drafting, -> { find_by_kind('drafting') } + scope :informing, -> { find_by_kind('informing') } scope :accepting, -> { find_by_kind('accepting')} scope :reviewing, -> { find_by_kind('reviewing')} scope :selecting, -> { find_by_kind('selecting')} diff --git a/app/views/budgets/index.html.erb b/app/views/budgets/index.html.erb index 9c0f08a85..99571e70a 100644 --- a/app/views/budgets/index.html.erb +++ b/app/views/budgets/index.html.erb @@ -67,9 +67,14 @@