Support login with javascript disabled
Change-Id: I023acc73c9713df917d4fb3cfeac7e920f0d65e4
diff --git a/Gruntfile.js b/Gruntfile.js
index 7311342..af74d0e 100644
--- a/Gruntfile.js
+++ b/Gruntfile.js
@@ -113,7 +113,7 @@
},
watch: {
css: {
- files: ['dev/scss/{util,base,fonts,kalamar,media}.scss',
+ files: ['dev/scss/{util,base,fonts,kalamar,media,no-js}.scss',
'dev/scss/footer/footer.scss',
'dev/scss/sidebar/sidebar.scss',
'dev/scss/header/{header,hint,menu,searchbar,vc,datepicker}.scss',
diff --git a/dev/scss/kalamar.scss b/dev/scss/kalamar.scss
index d8a9272..4c4407f 100644
--- a/dev/scss/kalamar.scss
+++ b/dev/scss/kalamar.scss
@@ -11,4 +11,5 @@
@import "header/header"; // Top frame styles
@import "footer/footer"; // Bottom frame styles
@import "sidebar/sidebar"; // Left frame styles
+@import "no-js"; // Script disabled
@import "media"; // Media queries
diff --git a/dev/scss/no-js.scss b/dev/scss/no-js.scss
new file mode 100644
index 0000000..8e3478e
--- /dev/null
+++ b/dev/scss/no-js.scss
@@ -0,0 +1,37 @@
+// Aside in noscript mode
+body.no-js aside {
+ > * {
+ opacity: 1 !important;
+ transition: none;
+ }
+ transition: none;
+ position: relative;
+ margin-left: 0 !important;
+ display: block;
+ padding-top:0;
+ width: 100%;
+ top: 0;
+ form.login {
+ > input, > div {
+ width: auto;
+ margin-top: 0;
+ &:first-of-type {
+ float: left;
+ margin-right: 1em;
+ }
+ }
+ button {
+ height: 100%
+ }
+ }
+ &::after {
+ display: none;
+ }
+ p {
+ display: none;
+ }
+}
+
+body.no-js main div.intro {
+ margin-left: $base-padding !important;
+}
\ No newline at end of file
diff --git a/dev/scss/sidebar/sidebar.scss b/dev/scss/sidebar/sidebar.scss
index bb5df9f..8e6491b 100644
--- a/dev/scss/sidebar/sidebar.scss
+++ b/dev/scss/sidebar/sidebar.scss
@@ -202,6 +202,7 @@
display:none;
}
+
/*
#sidebar {
text-shadow: none;
diff --git a/templates/layouts/main.html.ep b/templates/layouts/main.html.ep
index f91aab7..763ac98 100644
--- a/templates/layouts/main.html.ep
+++ b/templates/layouts/main.html.ep
@@ -16,7 +16,8 @@
</head>
% my $embedded = 0;
% $embedded = 1 if stash('embedded');
- <body<% if ($embedded) { %> class="embedded"<% } %>>
+ <body class="no-js<% if ($embedded) { %> embedded<% } %>">
+ <script>document.body.classList.remove('no-js');</script>
<div id="kalamar-bg"></div>
% if (!$embedded && !user_auth && stash('auth_support')) { # user not logged in
@@ -25,7 +26,7 @@
% param(handle_or_email => flash('handle_or_email'));
% };
<fieldset>
- %= form_for 'login', begin
+ %= form_for 'login', class => 'login', begin
<legend><span><%= loc 'login' %></span></legend>
%= text_field 'handle_or_email', placeholder => loc('userormail')
<div>