brilo-example/templates/list_post/list.html.twig

37 lines
1.6 KiB
Twig
Raw Normal View History

{% extends 'base.html.twig' %}
{% block body %}
{% for post in posts %}
<div class="card t-post-detail">
<div class="card-header">
<a class="t-detail-a" href="{{ path('detail_post', {postId: post.id}) }}">#{{ post.id }} - <span class="t-post-title">{{ post.title|u.truncate(80, '...', true)}}</span></a>
</div>
<div class="card-body">
<p class="card-text t-post-body">
{{ post.body|u.truncate(80, '...', true) }}
</p>
</div>
</div>
{% endfor %}
<nav aria-label="Page navigation">
<ul class="pagination t-pagination">
{% if not page.firstPageVisible %}
<li class="page-item t-page-item"><a class="page-link t-page-link" href="{{ path('page_list', {page: 1}) }}">1&mldr;</a></li>
{% endif %}
{% for i in page.visiblePages %}
<li class="page-item {% if i == page.currentPage %}active{% endif %} t-page-item">
{% if i == page.currentPage %}
<span class="page-link">{{ i }}</span>
{% else %}
<a class="page-link t-page-link" href="{{ path('page_list', {page: i}) }}">{{ i }}</a>
{% endif %}
</li>
{% endfor %}
{% if not page.lastPageVisible %}
<li class="page-item t-page-item"><a class="page-link t-page-link" href="{{ path('page_list', {page: page.lastPage}) }}">&mldr;{{ page.lastPage }}</a></li>
{% endif %}
</ul>
</nav>
{% endblock %}