From 8acadeea7622e7ed828b9bba494a9fdd9370ad29 Mon Sep 17 00:00:00 2001
From: Sorin Davidoi <sorin.davidoi@gmail.com>
Date: Thu, 8 Jun 2017 00:52:56 +0200
Subject: [PATCH] fix: Warn if JavaScript is disabled (#3634)

---
 app/javascript/styles/components.scss | 9 +++++++++
 app/views/home/index.html.haml        | 4 ++++
 config/locales/en.yml                 | 1 +
 3 files changed, 14 insertions(+)

diff --git a/app/javascript/styles/components.scss b/app/javascript/styles/components.scss
index 5026742255..6fa3c8dff2 100644
--- a/app/javascript/styles/components.scss
+++ b/app/javascript/styles/components.scss
@@ -3629,3 +3629,12 @@ button.icon-button.active i.fa-retweet {
     border-color: transparent transparent $ui-base-color;
   }
 }
+
+noscript {
+  text-align: center;
+
+  div {
+    font-size: 20px;
+    margin: 20px 0;
+  }
+}
diff --git a/app/views/home/index.html.haml b/app/views/home/index.html.haml
index 87cfcaff40..33c978c891 100644
--- a/app/views/home/index.html.haml
+++ b/app/views/home/index.html.haml
@@ -4,3 +4,7 @@
   = javascript_pack_tag 'application', integrity: true, crossorigin: 'anonymous'
 
 .app-holder#mastodon{ data: { props: Oj.dump(default_props) } }
+  %noscript
+    = image_tag asset_pack_path('logo.png')
+    %div
+      = t('errors.noscript')
diff --git a/config/locales/en.yml b/config/locales/en.yml
index 965bfbe477..6ea2eb6c17 100644
--- a/config/locales/en.yml
+++ b/config/locales/en.yml
@@ -231,6 +231,7 @@ en:
       content: Security verification failed. Are you blocking cookies?
       title: Security verification failed
     '429': Throttled
+    noscript: To use Mastodon, please enable JavaScript.
   exports:
     blocks: You block
     csv: CSV
-- 
GitLab