Commit 05e269d175998822ce3a439b86c5ff6cdd564179

Authored by Goutte
1 parent ceeb2f4a

Show an error message for users without javascript.

CHANGELOG.md
... ... @@ -23,7 +23,7 @@
23 23 - [ ] CRON statement to call it
24 24 - [x] Download raw data (tarball of CSV) for current time interval and targets
25 25 - [ ] Download raw data as NetCDF for current everything, via SAMP
26   -- [ ] Add a warning for users with javascript disabled
  26 +- [x] Add a warning for users with javascript disabled
27 27 - [ ] Set the log level to _error_ in production (see `web/run.py`)
28 28  
29 29  
... ...
web/static/css/main.css
... ... @@ -55,7 +55,7 @@ footer {
55 55 min-height: 1050px;
56 56 }
57 57  
58   -/** HEADER ********************************************************************/
  58 +/** HEADER *******************************************************************/
59 59  
60 60 header.header {
61 61 background-image: url("../img/header_logo.png");
... ... @@ -72,7 +72,7 @@ header.header {
72 72 font-style: italic;
73 73 }
74 74  
75   -/** MENU NAVIGATION ***********************************************************/
  75 +/** MENU NAVIGATION **********************************************************/
76 76  
77 77 nav#menu {
78 78 background-color: #004F8D;
... ... @@ -121,7 +121,7 @@ nav#menu ul li a {
121 121 padding: 10px 15px;
122 122 }
123 123  
124   -/** STYLE *********************************************************************/
  124 +/** STYLE ********************************************************************/
125 125  
126 126 a {
127 127 /*color: #003965;*/
... ... @@ -188,61 +188,96 @@ ul li {
188 188 /*padding: 10px 0;*/
189 189 /*}*/
190 190  
191   -/** LOADER ********************************************************************/
  191 +/** LOADER *******************************************************************/
192 192  
  193 +/*.loader {*/
  194 + /*transform: translate(50vw, 50vh);*/
  195 + /*height: 200px;*/
  196 + /*width: 200px;*/
  197 +/*}*/
193 198  
194   -.loader {
195   - transform: translate(50vw, 50vh);
196   - height: 200px;
197   - width: 200px;
198   -}
  199 +/*.loader .hole {*/
  200 + /*margin: -50%;*/
  201 + /*height: 100%;*/
  202 + /*width: 100%;*/
  203 + /*border-radius: 50%;*/
  204 + /*box-shadow: 0px 0px 30px #88ffff, 0px 0px 100px #000000 inset, 0px 0px 50px #55ffff inset, -20px -10px 100px #000000 inset;*/
  205 + /*background: #f08301;*/
  206 + /*-webkit-animation: shadowmove 8s infinite linear;*/
  207 +/*}*/
199 208  
200   -.loader .hole {
201   - margin: -50%;
202   - height: 100%;
203   - width: 100%;
204   - border-radius: 50%;
205   - box-shadow: 0px 0px 30px #88ffff, 0px 0px 100px #000000 inset, 0px 0px 50px #55ffff inset, -20px -10px 100px #000000 inset;
206   - background: #f08301;
207   - -webkit-animation: shadowmove 8s infinite linear;
208   -}
  209 +/*@-webkit-keyframes shadowmove {*/
  210 + /*0% {*/
  211 + /*box-shadow: 0px 0px 30px #88ffff, 0px 0px 100px #000000 inset, 0px 0px 50px #55ffff inset, -20px -10px 100px #000000 inset;*/
  212 + /*}*/
  213 + /*50% {*/
  214 + /*box-shadow: 0px 0px 30px #88ffff, 0px 0px 100px #000000 inset, 0px 0px 50px #55ffff inset, -220px -110px 100px #000000 inset;*/
  215 + /*}*/
  216 + /*50.01% {*/
  217 + /*box-shadow: 0px 0px 30px #88ffff, 0px 0px 100px #000000 inset, 0px 0px 50px #55ffff inset, 220px 110px 100px #000000 inset;*/
  218 + /*}*/
  219 + /*75% {*/
  220 + /*box-shadow: 0px 0px 30px #111111, 0px 0px 100px #000000 inset, 0px 0px 50px #55ffff inset, 220px 110px 100px #000000 inset;*/
  221 + /*}*/
  222 + /*90% {*/
  223 + /*box-shadow: 0px 0px 30px #88ffff, 0px 0px 100px #000000 inset, 0px 0px 50px #55ffff inset, 10px 20px 100px #000000 inset;*/
  224 + /*}*/
  225 +/*}*/
209 226  
210   -@-webkit-keyframes shadowmove {
211   - 0% {
212   - box-shadow: 0px 0px 30px #88ffff, 0px 0px 100px #000000 inset, 0px 0px 50px #55ffff inset, -20px -10px 100px #000000 inset;
213   - }
214   - 50% {
215   - box-shadow: 0px 0px 30px #88ffff, 0px 0px 100px #000000 inset, 0px 0px 50px #55ffff inset, -220px -110px 100px #000000 inset;
216   - }
217   - 50.01% {
218   - box-shadow: 0px 0px 30px #88ffff, 0px 0px 100px #000000 inset, 0px 0px 50px #55ffff inset, 220px 110px 100px #000000 inset;
219   - }
220   - 75% {
221   - box-shadow: 0px 0px 30px #111111, 0px 0px 100px #000000 inset, 0px 0px 50px #55ffff inset, 220px 110px 100px #000000 inset;
222   - }
223   - 90% {
224   - box-shadow: 0px 0px 30px #88ffff, 0px 0px 100px #000000 inset, 0px 0px 50px #55ffff inset, 10px 20px 100px #000000 inset;
225   - }
226   -}
  227 +/*@-ms-keyframes spin {*/
  228 + /*from { -ms-transform: rotate(0deg); }*/
  229 + /*to { -ms-transform: rotate(360deg); }*/
  230 +/*}*/
  231 +/*@-moz-keyframes spin {*/
  232 + /*from { -moz-transform: rotate(0deg); }*/
  233 + /*to { -moz-transform: rotate(360deg); }*/
  234 +/*}*/
  235 +/*@-webkit-keyframes spin {*/
  236 + /*from { -webkit-transform: rotate(0deg); }*/
  237 + /*to { -webkit-transform: rotate(360deg); }*/
  238 +/*}*/
  239 +/*@keyframes spin {*/
  240 + /*from { transform:rotate(0deg); }*/
  241 + /*to { transform:rotate(360deg); }*/
  242 +/*}*/
227 243  
228   -@-ms-keyframes spin {
229   - from { -ms-transform: rotate(0deg); }
230   - to { -ms-transform: rotate(360deg); }
231   -}
232   -@-moz-keyframes spin {
233   - from { -moz-transform: rotate(0deg); }
234   - to { -moz-transform: rotate(360deg); }
  244 +/** NO JAVASCRIPT ************************************************************/
  245 +
  246 +#nojs-alert {
  247 + position: fixed;
  248 + z-index: 2000;
  249 + top: 0;
  250 + left: 0;
235 251 }
236   -@-webkit-keyframes spin {
237   - from { -webkit-transform: rotate(0deg); }
238   - to { -webkit-transform: rotate(360deg); }
  252 +
  253 +.nojs {
  254 + background: #c5423c;
  255 + color: #eeeeee;
  256 +
  257 + text-align: center;
  258 + font-family: "DejaVu Sans Mono", monospace;
  259 +
  260 + opacity: 0;
  261 + animation: 1.618s fadeIn;
  262 + animation-delay: 1.618s;
  263 + animation-fill-mode: forwards;
  264 +
  265 + pointer-events: none;
  266 +
  267 + padding: 1em 0;
  268 + width: 100%;
239 269 }
240   -@keyframes spin {
241   - from { transform:rotate(0deg); }
242   - to { transform:rotate(360deg); }
  270 +
  271 +@keyframes fadeIn {
  272 + 0% {
  273 + opacity: 0;
  274 + }
  275 + 100% {
  276 + opacity: 1;
  277 + }
243 278 }
244 279  
245   -/** MEDIA QUERIES *************************************************************/
  280 +/** MEDIA QUERIES ************************************************************/
246 281  
247 282 @media all and (max-width: 980px) {
248 283 #page-container{
... ...
web/static/js/swapp.js
... ... @@ -22,7 +22,7 @@
22 22 function SpaceWeather(configuration){
23 23 var configs, res$, k, this$ = this;
24 24 this.configuration = configuration;
25   - console.info(" _ _ _ _ ____\n | | | | ___| (_) ___ | _ \ _ __ ___ _ __ __ _\n | |_| |/ _ \ | |/ _ \| |_) | '__/ _ \| '_ \ / _` |\n | _ | __/ | | (_) | __/| | | (_) | |_) | (_| |\n |_| |_|\___|_|_|\___/|_|_ |_|_ \___/| .__/ \__,_|\n | |__ _ _ / ___| _ \| _ \| _ \_|\n | '_ \| | | | | | | | | | |_) | |_) |\n | |_) | |_| | | |___| |_| | __/| __/\n |_.__/ \__, | \____|____/|_| |_|\n |___/\n\nThe full source of this website is available at :\nhttps://gitlab.irap.omp.eu/CDPP/SPACEWEATHERONLINE");
  25 + console.info("©2017\n _ _ _ _ ____\n | | | | ___| (_) ___ | _ \ _ __ ___ _ __ __ _\n | |_| |/ _ \ | |/ _ \| |_) | '__/ _ \| '_ \ / _` |\n | _ | __/ | | (_) | __/| | | (_) | |_) | (_| |\n |_| |_|\___|_|_|\___/|_|_ |_|_ \___/| .__/ \__,_|\n | |__ _ _ / ___| _ \| _ \| _ \_|\n | '_ \| | | | | | | | | | |_) | |_) |\n | |_) | |_| | | |___| |_| | __/| __/\n |_.__/ \__, | \____|____/|_| |_|\n |___/\n\nThe full source of this website is available at :\nhttps://gitlab.irap.omp.eu/CDPP/SPACEWEATHERONLINE");
26 26 this.targets = {};
27 27 res$ = [];
28 28 for (k in this.configuration.targets) {
... ... @@ -109,10 +109,10 @@
109 109 });
110 110 };
111 111 SpaceWeather.prototype.showLoader = function(){
112   - return $("#plots_loader").show();
  112 + return $('#plots_loader').show();
113 113 };
114 114 SpaceWeather.prototype.hideLoader = function(){
115   - return $("#plots_loader").hide();
  115 + return $('#plots_loader').hide();
116 116 };
117 117 SpaceWeather.prototype.loadData = function(target_slug, started_at, stopped_at){
118 118 "Load the data as CSV for the specified target and interval,\nand return it in a Promise.";
... ...
web/static/js/swapp.ls
... ... @@ -39,7 +39,7 @@ export class SpaceWeather
39 39 INPUT_TIME_FORMAT = "YYYY-MM-DD"
40 40  
41 41 (@configuration) ->
42   - console.info """
  42 + console.info """©2017
43 43 _ _ _ _ ____
44 44 | | | | ___| (_) ___ | _ \\ _ __ ___ _ __ __ _
45 45 | |_| |/ _ \\ | |/ _ \\| |_) | '__/ _ \\| '_ \\ / _` |
... ... @@ -121,10 +121,10 @@ https://gitlab.irap.omp.eu/CDPP/SPACEWEATHERONLINE
121 121 @timeSeries.forEach((ts) -> ts.resize())
122 122  
123 123 showLoader: ->
124   - $("\#plots_loader").show();
  124 + $('#plots_loader').show();
125 125  
126 126 hideLoader: ->
127   - $("\#plots_loader").hide();
  127 + $('#plots_loader').hide();
128 128  
129 129 loadData: (target_slug, started_at, stopped_at) ->
130 130 """
... ...
web/view/layout.html.jinja2
... ... @@ -29,6 +29,8 @@
29 29  
30 30 <body>
31 31  
  32 + <div id="nojs-alert" class="nojs">Heliopropa requires javascript. </div>
  33 +
32 34 <div id="page-container" class="container">
33 35  
34 36 <header class="header mdl-layout__header">
... ... @@ -45,8 +47,7 @@
45 47 </div>
46 48 </header>
47 49  
48   - <div class="">
49   -
  50 +{# <div class="">#}
50 51 {# <nav id="menu" role="navigation">#}
51 52 {# <ul>#}
52 53 {# <li class="home{% if menu_section == 'home' %} active{% endif %}">#}
... ... @@ -57,9 +58,7 @@
57 58 {# </li>#}
58 59 {# </ul>#}
59 60 {# </nav>#}
60   -
61   -
62   - </div>
  61 +{# </div>#}
63 62  
64 63 <div id="content">
65 64 {% block content %}
... ...