Software zum Installieren eines Smart-Mirror Frameworks , zum Nutzen von hochschulrelevanten Informationen, auf einem Raspberry-Pi.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

forecast.njk 2.2KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. {% if forecast %}
  2. {% set numSteps = forecast | calcNumSteps %}
  3. {% set currentStep = 0 %}
  4. <table class="{{ config.tableClass }}">
  5. {% if config.ignoreToday %}
  6. {% set forecast = forecast.splice(1) %}
  7. {% endif %}
  8. {% set forecast = forecast.slice(0, numSteps) %}
  9. {% for f in forecast %}
  10. <tr {% if config.colored %}class="colored"{% endif %} {% if config.fade %}style="opacity: {{ currentStep | opacity(numSteps) }};"{% endif %}>
  11. {% if (currentStep == 0) and config.ignoreToday == false %}
  12. <td class="day">{{ "TODAY" | translate }}</td>
  13. {% elif (currentStep == 1) and config.ignoreToday == false %}
  14. <td class="day">{{ "TOMORROW" | translate }}</td>
  15. {% else %}
  16. <td class="day">{{ f.date.format('ddd') }}</td>
  17. {% endif %}
  18. <td class="bright weather-icon"><span class="wi weathericon wi-{{ f.weatherType }}"></span></td>
  19. <td class="align-right bright max-temp">
  20. {{ f.maxTemperature | roundValue | unit("temperature") | decimalSymbol }}
  21. </td>
  22. <td class="align-right min-temp">
  23. {{ f.minTemperature | roundValue | unit("temperature") | decimalSymbol }}
  24. </td>
  25. {% if config.showPrecipitationAmount %}
  26. {% if f.precipitationUnits %}
  27. <td class="align-right bright precipitation">
  28. {{ f.precipitation }}{{ f.precipitationUnits }}
  29. </td>
  30. {% else %}
  31. <td class="align-right bright precipitation">
  32. {{ f.precipitation | unit("precip") }}
  33. </td>
  34. {% endif %}
  35. {% endif %}
  36. </tr>
  37. {% set currentStep = currentStep + 1 %}
  38. {% endfor %}
  39. </table>
  40. {% else %}
  41. <div class="dimmed light small">
  42. {{ "LOADING" | translate }}
  43. </div>
  44. {% endif %}
  45. <!-- Uncomment the line below to see the contents of the `forecast` object. -->
  46. <!-- <div style="word-wrap:break-word" class="xsmall dimmed">{{forecast | dump}}</div> -->