Commit f6b342300b1db7abea7bbce863b45be8e0f8fa6f

Authored by hitier
1 parent 9cea80b1
Exists in rhitier-dev

Reformat html

Showing 1 changed file with 30 additions and 29 deletions   Show diff stats
web/view/home.html.jinja2
@@ -261,36 +261,37 @@ var sw_configuration = { @@ -261,36 +261,37 @@ var sw_configuration = {
261 img: '{{ static('img/sun_128.png') }}' 261 img: '{{ static('img/sun_128.png') }}'
262 }, 262 },
263 targets: { 263 targets: {
264 -{% for target in targets %}  
265 - '{{ target.slug }}': {  
266 - slug: "{{ target.slug | escapejs }}",  
267 - name: "{{ target.name | escapejs }}",  
268 - active: {{ 'true' if target.default else 'false' }},  
269 - orbit: { a: {{ target.orbit.semimajor or 0 }}, b: {{ target.orbit.semiminor or 0 }} },  
270 - img: '{{ static('img/target/'~target.slug~'_128.png') }}',  
271 - layers: {  
272 -{% for catalog_slug, catalog_intervals in target.catalog_layers.items() %}  
273 - "{{ catalog_slug }}": [  
274 -{% for interval in catalog_intervals %}  
275 -{# { start: "2018-03-28T00:00:00Z", stop: "2018-03-29T00:00:00Z" }, #}  
276 - {# /!. All datetimes here MUST be suffixed by Z #}  
277 - { start: "{{ interval.start }}", stop: "{{ interval.stop }}" }{{ ',' if not loop.last }}  
278 -{% endfor %}  
279 - ]  
280 -{% endfor %}  
281 - }  
282 - }{{ ',' if not loop.last }}  
283 -{% endfor %} 264 + {% for target in targets %}
  265 + '{{ target.slug }}': {
  266 + slug: "{{ target.slug | escapejs }}",
  267 + type: "{{ target.type | escapejs }}",
  268 + name: "{{ target.name | escapejs }}",
  269 + active: {{ 'true' if target.default else 'false' }},
  270 + orbit: { a: {{ target.orbit.semimajor or 0 }}, b: {{ target.orbit.semiminor or 0 }} },
  271 + img: '{{ static('img/target/'~target.slug~'_128.png') }}',
  272 + layers: {
  273 + {% for catalog_slug, catalog_intervals in target.catalog_layers.items() %}
  274 + "{{ catalog_slug }}": [
  275 + {% for interval in catalog_intervals %}
  276 + {# { start: "2018-03-28T00:00:00Z", stop: "2018-03-29T00:00:00Z" }, #}
  277 + {# /!. All datetimes here MUST be suffixed by Z #}
  278 + { start: "{{ interval.start }}", stop: "{{ interval.stop }}" }{{ ',' if not loop.last }}
  279 + {% endfor %}
  280 + ]
  281 + {% endfor %}
  282 + }
  283 + }{{ ',' if not loop.last }}
  284 + {% endfor %}
284 }, 285 },
285 parameters: [ 286 parameters: [
286 -{% for p in parameters %}  
287 - {  
288 - id: "{{ p.slug | escapejs }}",  
289 - title: "{{ p.name | escapejs }} ({{ p.units | escapejs }})",  
290 - active: {{ 'true' if p.active else 'false' }},  
291 - unit: "{{ p.units | escapejs }}"  
292 - }{{ ',' if not loop.last }}  
293 -{% endfor %} 287 + {% for p in parameters %}
  288 + {
  289 + id: "{{ p.slug | escapejs }}",
  290 + title: "{{ p.name | escapejs }} ({{ p.units | escapejs }})",
  291 + active: {{ 'true' if p.active else 'false' }},
  292 + unit: "{{ p.units | escapejs }}"
  293 + }{{ ',' if not loop.last }}
  294 + {% endfor %}
294 ] 295 ]
295 {# ,#} 296 {# ,#}
296 {# layers: [#} 297 {# layers: [#}
@@ -304,7 +305,7 @@ var sw_configuration = { @@ -304,7 +305,7 @@ var sw_configuration = {
304 {# }{{ ',' if not loop.last }}#} 305 {# }{{ ',' if not loop.last }}#}
305 {#{% endfor %}#} 306 {#{% endfor %}#}
306 {# ]#} 307 {# ]#}
307 -}; 308 +}; // end of sw_configuration
308 309
309 var sw; 310 var sw;
310 jQuery().ready(function($){ 311 jQuery().ready(function($){