diff --git a/app/controllers/admin/legislation/processes_controller.rb b/app/controllers/admin/legislation/processes_controller.rb index 5d8d828cd..da27f9955 100644 --- a/app/controllers/admin/legislation/processes_controller.rb +++ b/app/controllers/admin/legislation/processes_controller.rb @@ -47,9 +47,12 @@ class Admin::Legislation::ProcessesController < Admin::Legislation::BaseControll :draft_publication_date, :allegations_start_date, :allegations_end_date, + :proposals_phase_start_date, + :proposals_phase_end_date, :result_publication_date, :debate_phase_enabled, :allegations_phase_enabled, + :proposals_phase_enabled, :draft_publication_enabled, :result_publication_enabled, :published diff --git a/app/models/legislation/process.rb b/app/models/legislation/process.rb index b6043df57..0f596b8f8 100644 --- a/app/models/legislation/process.rb +++ b/app/models/legislation/process.rb @@ -2,7 +2,7 @@ class Legislation::Process < ActiveRecord::Base acts_as_paranoid column: :hidden_at include ActsAsParanoidAliases - PHASES_AND_PUBLICATIONS = %i(debate_phase allegations_phase draft_publication result_publication).freeze + PHASES_AND_PUBLICATIONS = %i(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', dependent: :destroy @@ -33,6 +33,10 @@ class Legislation::Process < ActiveRecord::Base Legislation::Process::Phase.new(allegations_start_date, allegations_end_date, allegations_phase_enabled) end + def proposals_phase + Legislation::Process::Phase.new(proposals_phase_start_date, proposals_phase_end_date, proposals_phase_enabled) + end + def draft_publication Legislation::Process::Publication.new(draft_publication_date, draft_publication_enabled) end diff --git a/app/views/admin/legislation/processes/_form.html.erb b/app/views/admin/legislation/processes/_form.html.erb index 205d97361..ed034544b 100644 --- a/app/views/admin/legislation/processes/_form.html.erb +++ b/app/views/admin/legislation/processes/_form.html.erb @@ -114,6 +114,39 @@ +
+
+ +
+
+ <%= t('admin.legislation.processes.form.start') %> +
+
+ <%= f.text_field :proposals_phase_start_date, + label: false, + value: format_date_for_calendar_form(@process.proposals_phase_start_date), + class: "js-calendar-full", + id: "proposals_phase_start_date" %> +
+
+ <%= t('admin.legislation.processes.form.end') %> +
+
+ <%= f.text_field :proposals_phase_end_date, + label: false, + value: format_date_for_calendar_form(@process.proposals_phase_end_date), + class: "js-calendar-full", + id: "proposals_phase_end_date" %> +
+
+ <%= f.check_box :proposals_phase_enabled, checked: @process.proposals_phase.enabled?, label: t('admin.legislation.processes.form.enabled') %> +
+ +
+
+
+
+
<%= f.label :draft_publication_date %> diff --git a/config/locales/en/admin.yml b/config/locales/en/admin.yml index 3f1b12189..3793b75a8 100644 --- a/config/locales/en/admin.yml +++ b/config/locales/en/admin.yml @@ -258,6 +258,7 @@ en: process: Process debate_phase: Debate phase allegations_phase: Allegations phase + proposals_phase: Proposals phase start: Start end: End use_markdown: Use Markdown to format the text diff --git a/config/locales/es/admin.yml b/config/locales/es/admin.yml index 9872baa0d..27262845d 100644 --- a/config/locales/es/admin.yml +++ b/config/locales/es/admin.yml @@ -258,6 +258,7 @@ es: process: Proceso debate_phase: Fase previa allegations_phase: Fase de alegaciones + proposals_phase: Fase de propuestas start: Inicio end: Fin use_markdown: Usa Markdown para formatear el texto