You are here

weather_detailed_forecast.html.twig in Weather 8

Same filename and directory in other branches
  1. 2.0.x templates/weather_detailed_forecast.html.twig
<div class="weather">
  {% for place in weather %}
    <p style="clear:left"><strong>{{ place.name }}</strong></p>
    {% if place.forecasts is empty%}
      {{'Currently, there is no weather information available.'|t }}
    {% endif %}
    {% for forecast in place.forecasts %}
      <p>
        {{ forecast.formatted_date }}
        {% if forecast.sun_info %}
          <br />
          {% if forecast.sun_info is iterable %}
            {{'Sunrise: @time'|t({'@time': forecast.sun_info.sunrise}) }}<br />
            {{'Sunset: @time'|t({'@time': forecast.sun_info.sunset}) }}
          {% else %}
            {{forecast.sun_info }}
          {% endif %}
        {% endif %}
      </p>
      <table>
        <thead>
        <th>{{ 'Time'|t }}</th>
        <th>{{ 'Forecast'|t }}</th>
        <th>{{ 'Temperature'|t }}</th>
        <th>{{ 'Precipitation'|t }}</th>
        <th>{{ 'Pressure'|t }}</th>
        <th>{{ 'Wind'|t }}</th>
        </thead>
        {% for time_range, data in forecast.time_ranges %}
          <tr>
            <td>{{ time_range }}</td>
            <td>
              {{ data.symbol }}
              {{ data.condition }}
            </td>
            <td>
              {{ data.temperature }}
              {% if data.windchill %}
                <br />
                {{'Feels like !temperature'|t({'!temperature': data.windchill}) }}
              {% endif %}
            </td>
            <td>{{ data.precipitation }}</td>
            <td>{{ data.pressure }}</td>
            <td>{{ data.wind }}</td>
          </tr>
        {% endfor %}
      </table>
    {% endfor %}
    {% if place.station %}
      <p style="clear:left">
        {{ 'Location of this weather station:'|t }}<br />
        {{ place.station }}
      </p>
    {% endif %}
    <p style="clear:left">
      {{ '<a href="@url">Weather forecast from yr.no</a>, delivered by the Norwegian Meteorological Institute and the NRK'|t({'@url': place["yr.no"]}) }}
    </p>
  {% endfor %}
</div>

File

templates/weather_detailed_forecast.html.twig
View source
  1. <div class="weather">
  2. {% for place in weather %}
  3. <p style="clear:left"><strong>{{ place.name }}</strong></p>
  4. {% if place.forecasts is empty%}
  5. {{'Currently, there is no weather information available.'|t }}
  6. {% endif %}
  7. {% for forecast in place.forecasts %}
  8. <p>
  9. {{ forecast.formatted_date }}
  10. {% if forecast.sun_info %}
  11. <br />
  12. {% if forecast.sun_info is iterable %}
  13. {{'Sunrise: @time'|t({'@time': forecast.sun_info.sunrise}) }}<br />
  14. {{'Sunset: @time'|t({'@time': forecast.sun_info.sunset}) }}
  15. {% else %}
  16. {{forecast.sun_info }}
  17. {% endif %}
  18. {% endif %}
  19. </p>
  20. <table>
  21. <thead>
  22. <th>{{ 'Time'|t }}</th>
  23. <th>{{ 'Forecast'|t }}</th>
  24. <th>{{ 'Temperature'|t }}</th>
  25. <th>{{ 'Precipitation'|t }}</th>
  26. <th>{{ 'Pressure'|t }}</th>
  27. <th>{{ 'Wind'|t }}</th>
  28. </thead>
  29. {% for time_range, data in forecast.time_ranges %}
  30. <tr>
  31. <td>{{ time_range }}</td>
  32. <td>
  33. {{ data.symbol }}
  34. {{ data.condition }}
  35. </td>
  36. <td>
  37. {{ data.temperature }}
  38. {% if data.windchill %}
  39. <br />
  40. {{'Feels like !temperature'|t({'!temperature': data.windchill}) }}
  41. {% endif %}
  42. </td>
  43. <td>{{ data.precipitation }}</td>
  44. <td>{{ data.pressure }}</td>
  45. <td>{{ data.wind }}</td>
  46. </tr>
  47. {% endfor %}
  48. </table>
  49. {% endfor %}
  50. {% if place.station %}
  51. <p style="clear:left">
  52. {{ 'Location of this weather station:'|t }}<br />
  53. {{ place.station }}
  54. </p>
  55. {% endif %}
  56. <p style="clear:left">
  57. {{ '<a href="@url">Weather forecast from yr.no</a>, delivered by the Norwegian Meteorological Institute and the NRK'|t({'@url': place["yr.no"]}) }}
  58. </p>
  59. {% endfor %}
  60. </div>