48 lines
2.2 KiB
Plaintext
Raw Normal View History

{% if forecast %}
{% set numSteps = forecast | calcNumSteps %}
2019-01-06 12:30:26 +01:00
{% set currentStep = 0 %}
<table class="{{ config.tableClass }}">
{% if config.ignoreToday %}
{% set forecast = forecast.splice(1) %}
{% endif %}
2019-01-06 12:30:26 +01:00
{% set forecast = forecast.slice(0, numSteps) %}
2018-12-27 17:14:03 +01:00
{% for f in forecast %}
<tr {% if config.colored %}class="colored"{% endif %} {% if config.fade %}style="opacity: {{ currentStep | opacity(numSteps) }};"{% endif %}>
{% if (currentStep == 0) and config.ignoreToday == false %}
2020-10-12 09:10:51 +02:00
<td class="day">{{ "TODAY" | translate }}</td>
{% elif (currentStep == 1) and config.ignoreToday == false %}
2020-10-12 09:10:51 +02:00
<td class="day">{{ "TOMORROW" | translate }}</td>
{% else %}
<td class="day">{{ f.date.format('ddd') }}</td>
{% endif %}
<td class="bright weather-icon"><span class="wi weathericon wi-{{ f.weatherType }}"></span></td>
<td class="align-right bright max-temp">
{{ f.maxTemperature | roundValue | unit("temperature") | decimalSymbol }}
2020-10-12 09:09:42 +02:00
</td>
2020-10-12 09:10:51 +02:00
<td class="align-right min-temp">
{{ f.minTemperature | roundValue | unit("temperature") | decimalSymbol }}
2020-10-12 09:10:51 +02:00
</td>
{% if config.showPrecipitationAmount %}
{% if f.precipitationUnits %}
<td class="align-right bright precipitation">
{{ f.precipitation }}{{ f.precipitationUnits }}
</td>
2021-05-21 12:11:58 -04:00
{% else %}
<td class="align-right bright precipitation">
{{ f.precipitation | unit("precip") }}
</td>
{% endif %}
2020-10-12 09:10:51 +02:00
{% endif %}
2018-12-27 17:14:03 +01:00
</tr>
2019-01-06 12:30:26 +01:00
{% set currentStep = currentStep + 1 %}
2018-12-27 17:14:03 +01:00
{% endfor %}
</table>
2018-07-02 15:43:24 +02:00
{% else %}
<div class="dimmed light small">
{{ "LOADING" | translate }}
</div>
2018-05-21 10:57:22 +02:00
{% endif %}
2017-10-01 13:50:15 +02:00
2019-05-14 15:00:30 -05:00
<!-- Uncomment the line below to see the contents of the `forecast` object. -->
2018-05-21 10:57:22 +02:00
<!-- <div style="word-wrap:break-word" class="xsmall dimmed">{{forecast | dump}}</div> -->