Define some actions on legislation processes as member actions
This commit is contained in:
@@ -13,14 +13,13 @@ class Legislation::ProcessesController < Legislation::BaseController
|
||||
if @process.allegations_phase.enabled? && @process.allegations_phase.started? && draft_version.present?
|
||||
redirect_to legislation_process_draft_version_path(@process, draft_version)
|
||||
elsif @process.debate_phase.enabled?
|
||||
redirect_to legislation_process_debate_path(@process)
|
||||
redirect_to debate_legislation_process_path(@process)
|
||||
else
|
||||
redirect_to legislation_process_allegations_path(@process)
|
||||
redirect_to allegations_legislation_process_path(@process)
|
||||
end
|
||||
end
|
||||
|
||||
def debate
|
||||
set_process
|
||||
@phase = :debate_phase
|
||||
|
||||
if @process.debate_phase.started?
|
||||
@@ -31,7 +30,6 @@ class Legislation::ProcessesController < Legislation::BaseController
|
||||
end
|
||||
|
||||
def draft_publication
|
||||
set_process
|
||||
@phase = :draft_publication
|
||||
|
||||
if @process.draft_publication.started?
|
||||
@@ -48,7 +46,6 @@ class Legislation::ProcessesController < Legislation::BaseController
|
||||
end
|
||||
|
||||
def allegations
|
||||
set_process
|
||||
@phase = :allegations_phase
|
||||
|
||||
if @process.allegations_phase.started?
|
||||
@@ -65,7 +62,6 @@ class Legislation::ProcessesController < Legislation::BaseController
|
||||
end
|
||||
|
||||
def result_publication
|
||||
set_process
|
||||
@phase = :result_publication
|
||||
|
||||
if @process.result_publication.started?
|
||||
@@ -81,9 +77,5 @@ class Legislation::ProcessesController < Legislation::BaseController
|
||||
end
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def set_process
|
||||
@process = ::Legislation::Process.find(params[:process_id])
|
||||
end
|
||||
end
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
<ul>
|
||||
<% if process.debate_phase.enabled? %>
|
||||
<li <%= "class=active" if phase == :debate_phase %>>
|
||||
<%= link_to legislation_process_debate_path(process) do %>
|
||||
<%= link_to debate_legislation_process_path(process) do %>
|
||||
<h4><%= t('legislation.processes.shared.debate_dates') %></h4>
|
||||
<p><%= format_date(process.debate_start_date) %> - <%= format_date(process.debate_end_date) %></p>
|
||||
<% end %>
|
||||
@@ -18,7 +18,7 @@
|
||||
|
||||
<% if process.draft_publication.enabled? %>
|
||||
<li <%= "class=active" if phase == :draft_publication %>>
|
||||
<%= link_to legislation_process_draft_publication_path(process) do %>
|
||||
<%= link_to draft_publication_legislation_process_path(process) do %>
|
||||
<h4><%= t('legislation.processes.shared.draft_publication_date') %></h4>
|
||||
<p><%= format_date(process.draft_publication_date) %></p>
|
||||
<% end %>
|
||||
@@ -27,7 +27,7 @@
|
||||
|
||||
<% if process.allegations_phase.enabled? %>
|
||||
<li <%= "class=active" if phase == :allegations_phase %>>
|
||||
<%= link_to legislation_process_allegations_path(process) do %>
|
||||
<%= link_to allegations_legislation_process_path(process) do %>
|
||||
<h4><%= t('legislation.processes.shared.allegations_dates') %></h4>
|
||||
<p><%= format_date(process.allegations_start_date) %> - <%= format_date(process.allegations_end_date) %></p>
|
||||
<% end %>
|
||||
@@ -36,7 +36,7 @@
|
||||
|
||||
<% if process.result_publication.enabled? %>
|
||||
<li <%= "class=active" if phase == :result_publication %>>
|
||||
<%= link_to legislation_process_result_publication_path(process) do %>
|
||||
<%= link_to result_publication_legislation_process_path(process) do %>
|
||||
<h4><%= t('legislation.processes.shared.result_publication_date') %></h4>
|
||||
<p><%= format_date(process.result_publication_date) %></p>
|
||||
<% end %>
|
||||
|
||||
Reference in New Issue
Block a user