Added proposals phase attributes to legislation processes form
Also added them to the list of accepted params and completed translations.
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -114,6 +114,39 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="small-12 medium-4 column">
|
||||
<label><%= t('admin.legislation.processes.form.proposals_phase') %></label>
|
||||
</div>
|
||||
<div class="small-12 medium-1 column legislation-process-start">
|
||||
<%= t('admin.legislation.processes.form.start') %>
|
||||
</div>
|
||||
<div class="small-12 medium-2 column">
|
||||
<%= 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" %>
|
||||
</div>
|
||||
<div class="small-12 medium-1 column legislation-process-end">
|
||||
<%= t('admin.legislation.processes.form.end') %>
|
||||
</div>
|
||||
<div class="small-12 medium-2 column">
|
||||
<%= 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" %>
|
||||
</div>
|
||||
<div class="small-12 medium-2 column">
|
||||
<%= f.check_box :proposals_phase_enabled, checked: @process.proposals_phase.enabled?, label: t('admin.legislation.processes.form.enabled') %>
|
||||
</div>
|
||||
|
||||
<div class="small-12 column">
|
||||
<hr>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="small-12 medium-4 column">
|
||||
<%= f.label :draft_publication_date %>
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user