templates/pages/sim/news.html.twig line 1

Open in your IDE?
  1. {% extends 'layouts/common/default.html.twig' %}
  2. {% set pageAttributes = pageAttributes is defined ? pageAttributes : { group: 'sim', section: 'sim' } %}
  3. {% set page_title = 'news.title'|trans %}
  4. {% block content %}
  5. <h1 class="is-Page-H1">{{ 'nav.news'|trans }}</h1>
  6. {% if firstPost is defined and firstPost is not empty%}
  7. <div class="is-Banner">
  8. <div class="is-Banner-Wrapper{% if firstPost.image is not empty and firstPost.image != ' ' %} is-Banner-Wrapper_WithImage{% endif %}">
  9. <a href="{{ path('news.get', {'id': firstPost.id}) }}" class="is-Banner-Wrapper-Link">
  10. {% if firstPost.image is not empty and firstPost.image != ' ' %}
  11. <img class="is-Banner-Image" src="{{ firstPost.image }}" alt="">
  12. {% endif %}
  13. <div class="is-Banner-Content">
  14. <h2 class="is-Banner-H2">{{ firstPost.title }}</h2>
  15. <p class="is-Banner-Text">{{ firstPost.content | u.truncate(250) | raw }}</p>
  16. </div>
  17. </a>
  18. </div>
  19. </div>
  20. {% endif %}
  21. <div class="is-row is-PostList is-Equalizer" is-data-equalizer-id="news-items">
  22. {% for post in posts %}
  23. <article class="is-Post is-col-xs-12 is-col-sm-12 is-col-md-4 is-col-lg-3">
  24. <a href="{{ path('news.get', {'id': post.id}) }}" class="is-Post-Link">
  25. <div class="is-Post-Image-Wrapper">
  26. <img class="is-Post-Image" src="{{ (post.image is empty or post.image|trim == '') ? asset('img/sim/img_default.png') : post.image }}" alt="">
  27. </div>
  28. <div class="is-Post-Content" is-data-equalizer-watch="news-items">
  29. <header>
  30. <h3 class="is-Post-Title is-Post-Title_Blue">{{ post.title }}</h3>
  31. </header>
  32. <p class="is-Post-Summary">{{ post.content|u.truncate(90)|raw }}</p>
  33. <footer class="is-Post-Footer">
  34. <span class="is-Post-Date is-Post-Date_Blue">{{ post.time_diff }}</span>
  35. </footer>
  36. </div>
  37. </a>
  38. </article>
  39. {% endfor %}
  40. </div>
  41. {% endblock %}