diff --git a/app/models/legislation/process.rb b/app/models/legislation/process.rb index be8cc74c3..dc880552b 100644 --- a/app/models/legislation/process.rb +++ b/app/models/legislation/process.rb @@ -18,8 +18,8 @@ class Legislation::Process < ActiveRecord::Base translates :homepage, touch: true include Globalizable - PHASES_AND_PUBLICATIONS = %i[draft_phase debate_phase allegations_phase proposals_phase - draft_publication result_publication].freeze + PHASES_AND_PUBLICATIONS = %i[homepage_phase draft_phase debate_phase allegations_phase + proposals_phase draft_publication result_publication].freeze has_many :draft_versions, -> { order(:id) }, class_name: 'Legislation::DraftVersion', foreign_key: 'legislation_process_id', @@ -54,6 +54,10 @@ class Legislation::Process < ActiveRecord::Base draft_end_date IS NOT NULL and (draft_start_date > ? or draft_end_date < ?))", Date.current, Date.current) } + def homepage_phase + Legislation::Process::Phase.new(start_date, end_date, homepage_enabled) + end + def draft_phase Legislation::Process::Phase.new(draft_start_date, draft_end_date, draft_phase_enabled) end diff --git a/app/views/legislation/processes/_header.html.erb b/app/views/legislation/processes/_header.html.erb index 2c3eb22b1..4c6acea90 100644 --- a/app/views/legislation/processes/_header.html.erb +++ b/app/views/legislation/processes/_header.html.erb @@ -34,6 +34,30 @@ url: legislation_process_url(@process), description: @process.title } %> + + <% if process.draft_publication.enabled? %> +
+ ++ <%= link_to draft_publication_legislation_process_path(@process) do %> + <%= format_date(process.draft_publication_date) %> + <% end %> +
+ <% end %> + + <% if process.result_publication.enabled? %> + + ++ <%= link_to result_publication_legislation_process_path(@process) do %> + <%= format_date(process.result_publication_date) %> + <% end %> +
+ <% end %> diff --git a/app/views/legislation/processes/_key_dates.html.erb b/app/views/legislation/processes/_key_dates.html.erb index 7181e68cf..835aeff34 100644 --- a/app/views/legislation/processes/_key_dates.html.erb +++ b/app/views/legislation/processes/_key_dates.html.erb @@ -6,6 +6,15 @@ <% end %>