Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 16 additions & 14 deletions src/App/templates/partial/pagination.html.twig
Original file line number Diff line number Diff line change
@@ -1,22 +1,24 @@
<nav class="pagination-row mt-3" aria-label="{{ aria_label }}">
<a class="btn btn-ghost btn-sm {% if data.isFirstPage %}disabled{% endif %}"
href="?page={{ data.firstPage }}" aria-label="First page">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
style="width:14px;height:14px;" aria-hidden="true">
<path d="M17 18l-6-6 6-6M11 18l-6-6 6-6"/>
</svg>
</a>
{% if not data.isFirstPage %}
<a class="btn btn-ghost btn-sm" href="?page={{ data.firstPage }}" aria-label="First page">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
style="width:14px;height:14px;" aria-hidden="true">
<path d="M17 18l-6-6 6-6M11 18l-6-6 6-6"/>
</svg>
</a>
{% endif %}

{% for p in data.pages %}
<a class="btn btn-sm {% if p == data.currentPage %}btn-primary{% else %}btn-ghost{% endif %}"
href="?page={{ p }}">{{ p }}</a>
{% endfor %}

<a class="btn btn-ghost btn-sm {% if data.isLastPage %}disabled{% endif %}"
href="?page={{ data.lastPage }}" aria-label="Last page">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
style="width:14px;height:14px;" aria-hidden="true">
<path d="M7 18l6-6-6-6M13 18l6-6-6-6"/>
</svg>
</a>
{% if not data.isLastPage %}
<a class="btn btn-ghost btn-sm" href="?page={{ data.lastPage }}" aria-label="Last page">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
style="width:14px;height:14px;" aria-hidden="true">
<path d="M7 18l6-6-6-6M13 18l6-6-6-6"/>
</svg>
</a>
{% endif %}
</nav>
13 changes: 1 addition & 12 deletions src/Blog/templates/page/tag-resource.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -42,18 +42,7 @@
</div>

{% if data.lastPage > 1 %}
<nav class="pagination-row mt-3" aria-label="Tag posts pagination">
<a class="btn btn-ghost btn-sm {% if data.isFirstPage %}disabled{% endif %}"
href="?page={{ data.previousPage }}" aria-label="Previous page">←</a>

{% for p in data.pages %}
<a class="btn btn-sm {% if p == data.currentPage %}btn-primary{% else %}btn-ghost{% endif %}"
href="?page={{ p }}">{{ p }}</a>
{% endfor %}

<a class="btn btn-ghost btn-sm {% if data.isLastPage %}disabled{% endif %}"
href="?page={{ data.nextPage }}" aria-label="Next page">→</a>
</nav>
{{ include('@partial/pagination.html.twig', {data: data, aria_label: 'Tag posts pagination'}) }}

<p class="post-date pagination-summary">
Page {{ data.currentPage }} of {{ data.lastPage }}
Expand Down