From 8fcfcddc8fc3d36a5b1daa1f74e69512fc66d565 Mon Sep 17 00:00:00 2001 From: Lynx Kotoura Date: Thu, 21 Sep 2017 02:41:35 +0900 Subject: Fix theme translations alphabetically (#5031) --- config/locales/en.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'config/locales/en.yml') diff --git a/config/locales/en.yml b/config/locales/en.yml index 0f3812aff..13280303c 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -461,8 +461,6 @@ en: settings: Settings two_factor_authentication: Two-factor Authentication your_apps: Your applications - themes: - default: Mastodon statuses: open_in_web: Open in web over_character_limit: character limit of %{max} exceeded @@ -554,6 +552,8 @@ en:

Originally adapted from the Discourse privacy policy.

title: "%{instance} Terms of Service and Privacy Policy" + themes: + default: Mastodon time: formats: default: "%b %d, %Y, %H:%M" -- cgit From 2c8e3fbbfbe26fb78418324ef14caf13ab207623 Mon Sep 17 00:00:00 2001 From: Eugen Rochko Date: Mon, 25 Sep 2017 04:04:04 +0200 Subject: Generate 500.html with assets:precompile, remove loading from Google Fonts (#5067) --- .gitignore | 1 + app/javascript/styles/basics.scss | 21 +++++++++++++++++++ app/views/errors/500.html.haml | 5 +++++ app/views/layouts/error.html.haml | 28 +++---------------------- config/i18n-tasks.yml | 1 + config/locales/en.yml | 1 + lib/tasks/assets.rake | 8 ++++++++ public/500.html | 43 --------------------------------------- 8 files changed, 40 insertions(+), 68 deletions(-) create mode 100644 app/views/errors/500.html.haml create mode 100644 lib/tasks/assets.rake delete mode 100644 public/500.html (limited to 'config/locales/en.yml') diff --git a/.gitignore b/.gitignore index 38ebc934f..2f5f1e71a 100644 --- a/.gitignore +++ b/.gitignore @@ -21,6 +21,7 @@ public/system public/assets public/packs public/packs-test +public/500.html .env .env.production node_modules/ diff --git a/app/javascript/styles/basics.scss b/app/javascript/styles/basics.scss index c5f98750c..48652a035 100644 --- a/app/javascript/styles/basics.scss +++ b/app/javascript/styles/basics.scss @@ -62,6 +62,27 @@ body { height: 100%; padding: 0; } + + &.error { + text-align: center; + color: $ui-primary-color; + padding: 20px; + + .dialog img { + display: block; + margin: 20px auto; + margin-top: 50px; + max-width: 600px; + width: 100%; + height: auto; + } + + .dialog h1 { + font-size: 20px; + line-height: 28px; + font-weight: 400; + } + } } button { diff --git a/app/views/errors/500.html.haml b/app/views/errors/500.html.haml new file mode 100644 index 000000000..e124be551 --- /dev/null +++ b/app/views/errors/500.html.haml @@ -0,0 +1,5 @@ +- content_for :page_title do + = t('errors.500') + +- content_for :content do + = t('errors.500') diff --git a/app/views/layouts/error.html.haml b/app/views/layouts/error.html.haml index 08b94af54..0b5f908ae 100644 --- a/app/views/layouts/error.html.haml +++ b/app/views/layouts/error.html.haml @@ -5,31 +5,9 @@ %meta{ charset: 'utf-8' }/ %title= yield :page_title %meta{ content: 'width=device-width,initial-scale=1', name: 'viewport' }/ - %link{ href: 'https://fonts.googleapis.com/css?family=Roboto:400', rel: 'stylesheet' }/ - :css - body { - font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; - background: #282c37; - color: #9baec8; - text-align: center; - margin: 0; - padding: 20px; - } - - .dialog img { - display: block; - margin: 20px auto; - margin-top: 50px; - max-width: 600px; - width: 100%; - height: auto; - } - - .dialog h1 { - font: 20px/28px -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; - font-weight: 400; - } - %body + = stylesheet_pack_tag 'common', media: 'all' + = stylesheet_pack_tag Setting.default_settings['theme'], media: 'all' + %body.error .dialog %img{ alt: 'Mastodon', src: '/oops.png' }/ %div diff --git a/config/i18n-tasks.yml b/config/i18n-tasks.yml index b51cf46df..b35e5c09a 100644 --- a/config/i18n-tasks.yml +++ b/config/i18n-tasks.yml @@ -45,6 +45,7 @@ ignore_missing: - 'sessions.{browsers,platforms}.*' - 'terms.body_html' - 'application_mailer.salutation' + - 'errors.500' ignore_unused: - 'activemodel.errors.*' - 'activerecord.attributes.*' diff --git a/config/locales/en.yml b/config/locales/en.yml index 13280303c..cc440e1b0 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -310,6 +310,7 @@ en: content: Security verification failed. Are you blocking cookies? title: Security verification failed '429': Throttled + '500': We're sorry, but something went wrong. noscript_html: To use the Mastodon web application, please enable JavaScript. Alternatively, try one of the native apps for Mastodon for your platform. exports: blocks: You block diff --git a/lib/tasks/assets.rake b/lib/tasks/assets.rake new file mode 100644 index 000000000..cd0a3bd2b --- /dev/null +++ b/lib/tasks/assets.rake @@ -0,0 +1,8 @@ +# frozen_string_literal: true + +if Rake::Task.task_defined?('assets:precompile') + Rake::Task['assets:precompile'].enhance do + html = ApplicationController.render('errors/500', layout: 'error') + File.write(Rails.root.join('public', '500.html'), html) + end +end diff --git a/public/500.html b/public/500.html deleted file mode 100644 index d085d490b..000000000 --- a/public/500.html +++ /dev/null @@ -1,43 +0,0 @@ - - - - - We're sorry, but something went wrong - - - - - - -
- Mastodon - -
-

We're sorry, but something went wrong.

-
-
- - -- cgit From 3b60832214fdd9d8b5fd01e9a177a6dde5259907 Mon Sep 17 00:00:00 2001 From: Eugen Rochko Date: Mon, 25 Sep 2017 23:05:54 +0200 Subject: New error page graphic. Other error page improvements (#5099) - 500.html generated with admin-set default locale if set - Error page `` 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 --- app/javascript/styles/basics.scss | 5 ++--- app/views/errors/500.html.haml | 4 ++-- app/views/layouts/error.html.haml | 4 ++-- config/locales/en.yml | 4 +++- lib/tasks/assets.rake | 7 ++++--- public/oops.gif | Bin 0 -> 95633 bytes public/oops.png | Bin 120305 -> 0 bytes 7 files changed, 13 insertions(+), 11 deletions(-) create mode 100644 public/oops.gif delete mode 100644 public/oops.png (limited to 'config/locales/en.yml') diff --git a/app/javascript/styles/basics.scss b/app/javascript/styles/basics.scss index 48652a035..96f0023c3 100644 --- a/app/javascript/styles/basics.scss +++ b/app/javascript/styles/basics.scss @@ -70,9 +70,8 @@ body { .dialog img { display: block; - margin: 20px auto; - margin-top: 50px; - max-width: 600px; + margin: 0 auto; + max-width: 470px; width: 100%; height: auto; } diff --git a/app/views/errors/500.html.haml b/app/views/errors/500.html.haml index e124be551..6244ff209 100644 --- a/app/views/errors/500.html.haml +++ b/app/views/errors/500.html.haml @@ -1,5 +1,5 @@ - content_for :page_title do - = t('errors.500') + = t('errors.500.title') - content_for :content do - = t('errors.500') + = t('errors.500.content') diff --git a/app/views/layouts/error.html.haml b/app/views/layouts/error.html.haml index 0b5f908ae..31f322096 100644 --- a/app/views/layouts/error.html.haml +++ b/app/views/layouts/error.html.haml @@ -3,12 +3,12 @@ %head %meta{ content: 'text/html; charset=UTF-8', 'http-equiv' => 'Content-Type' }/ %meta{ charset: 'utf-8' }/ - %title= yield :page_title + %title= safe_join([yield(:page_title), title], ' - ') %meta{ content: 'width=device-width,initial-scale=1', name: 'viewport' }/ = stylesheet_pack_tag 'common', media: 'all' = stylesheet_pack_tag Setting.default_settings['theme'], media: 'all' %body.error .dialog - %img{ alt: 'Mastodon', src: '/oops.png' }/ + %img{ alt: title, src: '/oops.gif' }/ %div %h1= yield :content diff --git a/config/locales/en.yml b/config/locales/en.yml index cc440e1b0..f87d8532c 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -310,7 +310,9 @@ en: content: Security verification failed. Are you blocking cookies? title: Security verification failed '429': Throttled - '500': We're sorry, but something went wrong. + '500': + content: We're sorry, but something went wrong on our end. + title: This page is not correct 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. exports: blocks: You block diff --git a/lib/tasks/assets.rake b/lib/tasks/assets.rake index ad7c6ba90..2ef72fdef 100644 --- a/lib/tasks/assets.rake +++ b/lib/tasks/assets.rake @@ -3,15 +3,16 @@ namespace :assets do desc 'Generate 500.html' task :generate_500 do - html = ApplicationController.render('errors/500', layout: 'error') - File.write(Rails.root.join('public', '500.html'), html) + I18n.with_locale(ENV['DEFAULT_LOCALE'] || I18n.default_locale) do + html = ApplicationController.render('errors/500', layout: 'error') + File.write(Rails.root.join('public', '500.html'), html) + end end end if Rake::Task.task_defined?('assets:precompile') Rake::Task['assets:precompile'].enhance do Webpacker::Manifest.load - Rake::Task['assets:generate_500'].invoke end end diff --git a/public/oops.gif b/public/oops.gif new file mode 100644 index 000000000..ad19c4e10 Binary files /dev/null and b/public/oops.gif differ diff --git a/public/oops.png b/public/oops.png deleted file mode 100644 index 0abddad3e..000000000 Binary files a/public/oops.png and /dev/null differ -- cgit