From 6941cdc9627aeb86f997751eafcdf2790dc0aa5a Mon Sep 17 00:00:00 2001 From: Steffen van Bergerem Date: Thu, 31 Mar 2016 11:29:55 +0200 Subject: [PATCH] Add noscript warning --- app/assets/stylesheets/base.scss | 15 +++++++++++++++ app/views/layouts/application.html.haml | 4 ++++ config/locales/diaspora/en.yml | 1 + 3 files changed, 20 insertions(+) diff --git a/app/assets/stylesheets/base.scss b/app/assets/stylesheets/base.scss index 1e7f268d1..c05454901 100644 --- a/app/assets/stylesheets/base.scss +++ b/app/assets/stylesheets/base.scss @@ -86,6 +86,21 @@ pre { word-wrap: break-word; } &.visible { opacity: .5; } } +.noscript { + background-color: rgba($black, .9); + height: 100%; + margin-top: -50px; + position: fixed; + width: 100%; + z-index: 9001; + + h3 { + background-color: $white; + margin: 100px; + padding: 50px; + } +} + // general purpose classes .small-horizontal-spacer { diff --git a/app/views/layouts/application.html.haml b/app/views/layouts/application.html.haml index 67066ccd1..0de5871f5 100644 --- a/app/views/layouts/application.html.haml +++ b/app/views/layouts/application.html.haml @@ -49,6 +49,10 @@ %body{ class: "page-#{controller_name} action-#{action_name}" } = yield :before_content + %noscript + .noscript + %h3= t("error_messages.need_javascript") + = content_for?(:content) ? yield(:content) : yield = yield :after_content diff --git a/config/locales/diaspora/en.yml b/config/locales/diaspora/en.yml index 45a531106..a30f5333a 100644 --- a/config/locales/diaspora/en.yml +++ b/config/locales/diaspora/en.yml @@ -91,6 +91,7 @@ en: helper: invalid_fields: "Invalid fields" correct_the_following_errors_and_try_again: "Correct the following errors and try again." + need_javascript: "This website requires JavaScript to function properly. If you disabled JavaScript, please enable it and refresh this page." admins: admin_bar: