From 4ea5df40120dffca9b5125b71385c22c6e6d7424 Mon Sep 17 00:00:00 2001 From: Bertocq Date: Tue, 13 Jun 2017 23:50:45 +0200 Subject: [PATCH] Display only the Legislation Process dates for those phase/publication enabled --- .../legislation/processes/_process.html.erb | 56 ++++++++++++------- 1 file changed, 35 insertions(+), 21 deletions(-) diff --git a/app/views/legislation/processes/_process.html.erb b/app/views/legislation/processes/_process.html.erb index a0a2d2e37..d5e44076a 100644 --- a/app/views/legislation/processes/_process.html.erb +++ b/app/views/legislation/processes/_process.html.erb @@ -17,28 +17,42 @@ -
-
-

<%= t('legislation.processes.shared.key_dates') %>

+ <% if process.enabled_phases_and_publications_count.positive? %> + <% column_width = 12 / process.enabled_phases_and_publications_count %> +
+
+

<%= t('legislation.processes.shared.key_dates') %>

+
-
-
-
-
<%= t('legislation.processes.shared.debate_dates') %>
-

<%= format_date(process.debate_start_date) %> - <%= format_date(process.debate_end_date) %>

+
+ <% if process.debate_phase.enabled? %> +
+
<%= t('legislation.processes.shared.debate_dates') %>
+

<%= format_date(process.debate_start_date) %> - <%= format_date(process.debate_end_date) %>

+
+ <% end %> + + <% if process.draft_publication.enabled? %> +
+
<%= t('legislation.processes.shared.draft_publication_date') %>
+

<%= format_date(process.draft_publication_date) %>

+
+ <% end %> + + <% if process.allegations_phase.enabled? %> +
+
<%= t('legislation.processes.shared.allegations_dates') %>
+

<%= format_date(process.allegations_start_date) %> - <%= format_date(process.allegations_end_date) %>

+
+ <% end %> + + <% if process.result_publication.enabled? %> +
+
<%= t('legislation.processes.shared.result_publication_date') %>
+

<%= format_date(process.result_publication_date) %>

+
+ <% end %>
-
-
<%= t('legislation.processes.shared.draft_publication_date') %>
-

<%= format_date(process.draft_publication_date) %>

-
-
-
<%= t('legislation.processes.shared.allegations_dates') %>
-

<%= format_date(process.allegations_start_date) %> - <%= format_date(process.allegations_end_date) %>

-
-
-
<%= t('legislation.processes.shared.result_publication_date') %>
-

<%= format_date(process.result_publication_date) %>

-
-
+ <% end %>