You are here

live-weather.html.twig in Live Weather 8.2

Same filename and directory in other branches
  1. 8 templates/live-weather.html.twig

Template for the live weather list block

Available variables:

  • weather_detail: array of weather list.

File

templates/live-weather.html.twig
View source
  1. {#
  2. /**
  3. * @file
  4. * Template for the live weather list block
  5. *
  6. * Available variables:
  7. * - weather_detail: array of weather list.
  8. */
  9. #}
  10. {% spaceless %}
  11. <div class="live-weather-list">
  12. {% for var in weather_detail %}
  13. <div class="live-weather">
  14. <div class="city"><h3>{{ var.location }}</h3></div>
  15. <div class="temperature">
  16. <span class="label"> {{ 'Temperature'|t }} </span>
  17. <span class="data">{{ var.temperature }} &deg;{{ var.temperature_unit }} {{ var.text }}</span>
  18. </div>
  19. {% if var.image %}
  20. <div class="image">
  21. <span class="data"><img src="{{ var.image }}.png"/></span>
  22. </div>
  23. {% endif %}
  24. {% if var.wind %}
  25. <div class="wind">
  26. <span class="label">{{ 'Wind speed'|t }} </span>
  27. <span class="data">{{ var.wind }}</span>
  28. </div>
  29. {% endif %}
  30. {% if var.humidity %}
  31. <div class="humidity">
  32. <span class="label">{{ 'Humidity'|t }} </span>
  33. <span class="data">{{ var.humidity }}</span>
  34. </div>
  35. {% endif %}
  36. {% if var.visibility %}
  37. <div class="visibility">
  38. <span class="label">{{ 'Visibility'|t }} </span>
  39. <span class="data">{{ var.visibility }}</span>
  40. </div>
  41. {% endif %}
  42. {% if var.sunrise %}
  43. <div class="sunrise">
  44. <span class="label">{{ 'Sunrise'|t }} </span>
  45. <span class="data">{{ var.sunrise }}</span>
  46. </div>
  47. {% endif %}
  48. {% if var.sunset %}
  49. <div class="sunset">
  50. <span class="label">{{ 'Sunset'|t }} </span>
  51. <span class="data">{{ var.sunset }}</span>
  52. </div>
  53. {% endif %}
  54. </div>
  55. {% endfor %}
  56. </div>
  57. {% endspaceless %}