templates/blog/index.html.twig line 1

Open in your IDE?
  1. {% extends 'base.html.twig' %}
  2. {% block body_id 'blog_index' %}
  3. {% block main %}
  4.     <div class="section actions">
  5.         <a href="{{ path('admin_post_new') }}" class="btn btn-lg btn-block btn-success">
  6.             <i class="fa fa-plus" aria-hidden="true"></i> {{ 'action.submit-a-question'|trans }}
  7.         </a>
  8.         <br/>
  9.         <br/>
  10.     </div>
  11.     {{ parent() }}
  12.     {% for post in paginator.results %}
  13.         <article class="post">
  14.             <h2>
  15.                     {{ post.title }}
  16.             </h2>
  17.             <h2>
  18.                     {{ post.content }}
  19.             </h2>
  20.             <h2>
  21.                 <a href="{{ path('blog_post', {slug: post.slug}) }}">
  22.                     {{ post.summary }}
  23.                 </a>
  24.             </h2>
  25.             
  26.             
  27.             <p class="post-metadata">
  28.                 <span class="metadata"><i class="fa fa-calendar"></i> {{ post.publishedAt|format_datetime('long', 'medium', '', 'UTC') }}</span>
  29.                 <span class="metadata"><i class="fa fa-user"></i> {{ post.author.fullName }}</span>
  30.             </p>
  31.             {{ include('blog/_post_tags.html.twig') }}
  32.         </article>
  33.     {% else %}
  34.         <div class="well">{{ 'post.no_posts_found'|trans }}</div>
  35.     {% endfor %}
  36.     {% if paginator.hasToPaginate %}
  37.         <div class="navigation text-center">
  38.             <ul class="pagination">
  39.                 {% if paginator.hasPreviousPage %}
  40.                     <li class="prev"><a href="{{ path('blog_index_paginated', {page: paginator.previousPage, tag: tagName}) }}" rel="previous"><i class="fa fw fa-long-arrow-left"></i> {{ 'paginator.previous'|trans }}</a></li>
  41.                 {% else %}
  42.                     <li class="prev disabled"><span><i class="fa fw fa-arrow-left"></i> {{ 'paginator.previous'|trans }}</span></li>
  43.                 {% endif %}
  44.                 {% for i in 1..paginator.lastPage %}
  45.                     {% if i == paginator.currentPage %}
  46.                         <li class="active"><span>{{ i }} <span class="sr-only">{{ 'paginator.current'|trans }}</span></span></li>
  47.                     {% else %}
  48.                         <li><a href="{{ path('blog_index_paginated', {page: i, tag: tagName}) }}">{{ i }}</a></li>
  49.                     {% endif %}
  50.                 {% endfor %}
  51.                 {% if paginator.hasNextPage %}
  52.                     <li class="next"><a href="{{ path('blog_index_paginated', {page: paginator.nextPage, tag: tagName}) }}" rel="next">{{ 'paginator.next'|trans }} <i class="fa fw fa-arrow-right"></i></a></li>
  53.                 {% else %}
  54.                     <li class="next disabled"><span>{{ 'paginator.next'|trans }} <i class="fa fw fa-arrow-right"></i></span></li>
  55.                 {% endif %}
  56.             </ul>
  57.         </div>
  58.     {% endif %}
  59. {% endblock %}
  60. {% block sidebar %}
  61.     {{ parent() }}
  62.     {{ show_source_code(_self) }}
  63.     {{ include('blog/_rss.html.twig') }}
  64. {% endblock %}