diff --git a/app/views/form/_interruption_screen_banner.html.erb b/app/views/form/_interruption_screen_banner.html.erb new file mode 100644 index 000000000..14a89b770 --- /dev/null +++ b/app/views/form/_interruption_screen_banner.html.erb @@ -0,0 +1,13 @@ +<% if question.page.routed_to?(@log, current_user) %> + <%= govuk_panel( + classes: "app-panel--interruption", + ) do %> +

<%= display_title_text(title_text, lettings_log) %>

+ <% if informative_text.present? %> +

<%= display_informative_text(informative_text, lettings_log) %>

+ <% end %> + <% if question.hint_text.present? %> +

<%= question.hint_text&.html_safe %>

+ <% end %> + <% end %> +<% end %> diff --git a/app/views/form/_interruption_screen_question.html.erb b/app/views/form/_interruption_screen_question.html.erb index 713e5ef97..b07925d14 100644 --- a/app/views/form/_interruption_screen_question.html.erb +++ b/app/views/form/_interruption_screen_question.html.erb @@ -1,16 +1,4 @@ -<% if question.page.routed_to?(@log, current_user) %> - <%= govuk_panel( - classes: "app-panel--interruption", - ) do %> -

<%= display_title_text(title_text, lettings_log) %>

- <% if informative_text.present? %> -

<%= display_informative_text(informative_text, lettings_log) %>

- <% end %> - <% if question.hint_text.present? %> -

<%= question.hint_text&.html_safe %>

- <% end %> - <% end %> -<% end %> +<%= render partial: "form/interruption_screen_banner", locals: { question:, title_text:, informative_text:, lettings_log: } %>

Make sure these answers are all correct