Skip to content
This repository was archived by the owner on Dec 21, 2023. It is now read-only.

Commit 3b60832

Browse files
authored
New error page graphic. Other error page improvements (mastodon#5099)
- 500.html generated with admin-set default locale if set - Error page `<title>` includes Mastodon site title - 500 title changed to "This page is not correct" (ref: <https://www.youtube.com/watch?v=2VCAP_seh1A>) - 500 content appended with "on our end" to make clear it's not user's fault
1 parent 259181c commit 3b60832

File tree

7 files changed

+13
-11
lines changed

7 files changed

+13
-11
lines changed

app/javascript/styles/basics.scss

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,9 +70,8 @@ body {
7070

7171
.dialog img {
7272
display: block;
73-
margin: 20px auto;
74-
margin-top: 50px;
75-
max-width: 600px;
73+
margin: 0 auto;
74+
max-width: 470px;
7675
width: 100%;
7776
height: auto;
7877
}

app/views/errors/500.html.haml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
- content_for :page_title do
2-
= t('errors.500')
2+
= t('errors.500.title')
33

44
- content_for :content do
5-
= t('errors.500')
5+
= t('errors.500.content')

app/views/layouts/error.html.haml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@
33
%head
44
%meta{ content: 'text/html; charset=UTF-8', 'http-equiv' => 'Content-Type' }/
55
%meta{ charset: 'utf-8' }/
6-
%title= yield :page_title
6+
%title= safe_join([yield(:page_title), title], ' - ')
77
%meta{ content: 'width=device-width,initial-scale=1', name: 'viewport' }/
88
= stylesheet_pack_tag 'common', media: 'all'
99
= stylesheet_pack_tag Setting.default_settings['theme'], media: 'all'
1010
%body.error
1111
.dialog
12-
%img{ alt: 'Mastodon', src: '/oops.png' }/
12+
%img{ alt: title, src: '/oops.gif' }/
1313
%div
1414
%h1= yield :content

config/locales/en.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -310,7 +310,9 @@ en:
310310
content: Security verification failed. Are you blocking cookies?
311311
title: Security verification failed
312312
'429': Throttled
313-
'500': We're sorry, but something went wrong.
313+
'500':
314+
content: We're sorry, but something went wrong on our end.
315+
title: This page is not correct
314316
noscript_html: To use the Mastodon web application, please enable JavaScript. Alternatively, try one of the <a href="https://github.com/tootsuite/documentation/blob/master/Using-Mastodon/Apps.md">native apps</a> for Mastodon for your platform.
315317
exports:
316318
blocks: You block

lib/tasks/assets.rake

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,16 @@
33
namespace :assets do
44
desc 'Generate 500.html'
55
task :generate_500 do
6-
html = ApplicationController.render('errors/500', layout: 'error')
7-
File.write(Rails.root.join('public', '500.html'), html)
6+
I18n.with_locale(ENV['DEFAULT_LOCALE'] || I18n.default_locale) do
7+
html = ApplicationController.render('errors/500', layout: 'error')
8+
File.write(Rails.root.join('public', '500.html'), html)
9+
end
810
end
911
end
1012

1113
if Rake::Task.task_defined?('assets:precompile')
1214
Rake::Task['assets:precompile'].enhance do
1315
Webpacker::Manifest.load
14-
1516
Rake::Task['assets:generate_500'].invoke
1617
end
1718
end

public/oops.gif

93.4 KB
Loading

public/oops.png

-117 KB
Binary file not shown.

0 commit comments

Comments
 (0)