diff --git a/app/views/root/400.html.erb b/app/views/root/400.html.erb index f2d0df028..7356516fa 100644 --- a/app/views/root/400.html.erb +++ b/app/views/root/400.html.erb @@ -1,4 +1,4 @@ -<%= render partial: "four_hundred_error", locals: { +<%= render partial: "error_page", locals: { title: "Bad request - 400", heading: "Bad request", intro: '' diff --git a/app/views/root/404.html.erb b/app/views/root/404.html.erb index 8e387603a..2e1d27723 100644 --- a/app/views/root/404.html.erb +++ b/app/views/root/404.html.erb @@ -1,4 +1,4 @@ -<%= render partial: "four_hundred_error", locals: { +<%= render partial: "error_page", locals: { title: "Page not found - 404", heading: "Page not found", intro: '

If you entered a web address please check it was correct.

diff --git a/app/views/root/406.html.erb b/app/views/root/406.html.erb index 9e90c7a80..021318133 100644 --- a/app/views/root/406.html.erb +++ b/app/views/root/406.html.erb @@ -1,4 +1,4 @@ -<%= render partial: "four_hundred_error", locals: { +<%= render partial: "error_page", locals: { title: "Page not found - 406", heading: "The page you are looking for can't be found", intro: '

Please check that you have entered the correct web address, or try using the search box above or explore GOV.UK to find the information you need.

' diff --git a/app/views/root/410.html.erb b/app/views/root/410.html.erb index 05bb70abe..278a8f98b 100644 --- a/app/views/root/410.html.erb +++ b/app/views/root/410.html.erb @@ -1,4 +1,4 @@ -<%= render partial: "four_hundred_error", locals: { +<%= render partial: "error_page", locals: { title: "Page no longer here - 410", heading: "The page you are looking for is no longer here", intro: '

It may have been moved or replaced.

diff --git a/app/views/root/418.html.erb b/app/views/root/418.html.erb index aeed3b4eb..fbcf8733d 100644 --- a/app/views/root/418.html.erb +++ b/app/views/root/418.html.erb @@ -1,4 +1,4 @@ -<%= render partial: "four_hundred_error", locals: { +<%= render partial: "error_page", locals: { title: "This is a government website - 418", heading: "I am not a coffee pot", intro: "

I am a government website.

" diff --git a/app/views/root/500.html.erb b/app/views/root/500.html.erb index 3f670b80c..5bfecfae5 100644 --- a/app/views/root/500.html.erb +++ b/app/views/root/500.html.erb @@ -1 +1 @@ -<%= render partial: "five_hundred_error", locals: {status_code: 500} %> \ No newline at end of file +<%= render partial: "error_page", locals: {status_code: 500} %> diff --git a/app/views/root/501.html.erb b/app/views/root/501.html.erb index 877a73b00..e08aa4a2f 100644 --- a/app/views/root/501.html.erb +++ b/app/views/root/501.html.erb @@ -1 +1 @@ -<%= render partial: "five_hundred_error", locals: {status_code: 501} %> \ No newline at end of file +<%= render partial: "error_page", locals: {status_code: 501} %> diff --git a/app/views/root/503.html.erb b/app/views/root/503.html.erb index 9a15e40f7..cee06cdb3 100644 --- a/app/views/root/503.html.erb +++ b/app/views/root/503.html.erb @@ -1 +1 @@ -<%= render partial: "five_hundred_error", locals: {status_code: 503} %> \ No newline at end of file +<%= render partial: "error_page", locals: {status_code: 503} %> diff --git a/app/views/root/504.html.erb b/app/views/root/504.html.erb index 3f09f1d08..02fce4d2f 100644 --- a/app/views/root/504.html.erb +++ b/app/views/root/504.html.erb @@ -1 +1 @@ -<%= render partial: "five_hundred_error", locals: {status_code: 504} %> +<%= render partial: "error_page", locals: {status_code: 504} %> diff --git a/app/views/root/_error_page.html.erb b/app/views/root/_error_page.html.erb new file mode 100644 index 000000000..53377d507 --- /dev/null +++ b/app/views/root/_error_page.html.erb @@ -0,0 +1,32 @@ +<% title = "Sorry, we are experiencing technical difficulties (#{status_code} error)" unless local_assigns.include?(:title) %> +<% content_for :title, "#{title} - GOV.UK" %> + +<% content_for :body_classes, "mainstream error" %> + +<% content_for :wrapper_content do %> +
+ + +
+
+
+ <% if local_assigns.include?(:intro) %> + <%= raw intro %> + <% else %> +

Please try again in a few moments.

+ <% end %> +
+
+
+
+<% end %> + +<%= render partial: 'base' %> diff --git a/app/views/root/_five_hundred_error.html.erb b/app/views/root/_five_hundred_error.html.erb deleted file mode 100644 index ef96859a9..000000000 --- a/app/views/root/_five_hundred_error.html.erb +++ /dev/null @@ -1,23 +0,0 @@ -<% content_for :title, "Sorry, we are experiencing technical difficulties (#{status_code} error) - GOV.UK " %> - -<% content_for :body_classes, "mainstream error" %> - -<% content_for :wrapper_content do %> -
- - -
-
-
-

Please try again in a few moments.

-
-
-
-
-<% end %> - -<%= render partial: 'base' %> diff --git a/app/views/root/_four_hundred_error.html.erb b/app/views/root/_four_hundred_error.html.erb deleted file mode 100644 index 1854c2b13..000000000 --- a/app/views/root/_four_hundred_error.html.erb +++ /dev/null @@ -1,23 +0,0 @@ -<% content_for :title, "#{local_assigns[:title]} - GOV.UK" %> - -<% content_for :body_classes, "mainstream error" %> - -<% content_for :wrapper_content do %> -
- - -
-
-
- <%= raw local_assigns[:intro] %> -
-
-
-
-<% end %> - -<%= render partial: 'base' %>