fix: adds 'view all ...' button to dashboard widgets
This commit is contained in:
@@ -5,42 +5,46 @@
|
||||
|
||||
{% if paginator.lastPage > 1 %}
|
||||
<nav>
|
||||
<ul class="pagination justify-content-center">
|
||||
<ul class="mt-2 flex flex-row justify-content-center gap-1 py-1 text-white text-sm">
|
||||
<li class="page-item{{ _currentPage <= 1 ? ' disabled' : '' }}">
|
||||
<a class="page-link" href="{{ path(_currentRoute, _currentParams|merge({page: _currentPage - 1})) }}" aria-label="Previous">
|
||||
« {{ "Previous"|trans }}
|
||||
<a data-live-action="click->pagination#paginate"
|
||||
data-live-action-page-value="_currentPage - 1"
|
||||
class="page-link px-2.5 py-1 rounded-lg bg-orange-500 align-middle" href="{{ path(_currentRoute, _currentParams|merge({page: _currentPage - 1})) }}" aria-label="Previous">
|
||||
«
|
||||
</a>
|
||||
</li>
|
||||
{% set startPage = max(1, _currentPage - 2) %}
|
||||
{% set endPage = min(_lastPage, startPage + 4) %}
|
||||
{% if startPage > 1 %}
|
||||
<li class="page-item">
|
||||
<a class="page-link" href="{{ path(_currentRoute, _currentParams|merge({page: 1})) }}">1</a>
|
||||
<a data-live-action="click->pagination#paginate"
|
||||
data-live-action-page-value="1"
|
||||
class="page-link px-2.5 py-1 rounded-lg bg-orange-500 align-middle" href="{{ path(_currentRoute, _currentParams|merge({page: 1})) }}">1</a>
|
||||
</li>
|
||||
{% if startPage > 2 %}
|
||||
<li class="page-item disabled">
|
||||
<span class="page-link">...</span>
|
||||
<span class="page-link px-2.5 py-1 rounded-lg bg-orange-500 align-middle">...</span>
|
||||
</li>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
{% for i in startPage..endPage %}
|
||||
<li class="page-item {% if i == _currentPage %}active{% endif %}">
|
||||
<a class="page-link" href="{{ path(_currentRoute, _currentParams|merge({page: i})) }}">{{ i }}</a>
|
||||
<a class="page-link px-2.5 py-1 rounded-lg bg-orange-500 align-middle" href="#">{{ i }}</a>
|
||||
</li>
|
||||
{% endfor %}
|
||||
{% if endPage < _lastPage %}
|
||||
{% if endPage < _lastPage - 1 %}
|
||||
<li class="page-item disabled">
|
||||
<span class="page-link">...</span>
|
||||
<span class="page-link px-2.5 py-1 rounded-lg bg-orange-500 align-middle">...</span>
|
||||
</li>
|
||||
{% endif %}
|
||||
<li class="page-item">
|
||||
<a class="page-link" href="{{ path(_currentRoute, _currentParams|merge({page: _lastPage})) }}">{{ _lastPage }}</a>
|
||||
<a class="page-link px-2.5 py-1 rounded-lg bg-orange-500 align-middle" href="{{ path(_currentRoute, _currentParams|merge({page: _lastPage})) }}">{{ _lastPage }}</a>
|
||||
</li>
|
||||
{% endif %}
|
||||
<li class="page-item {{ _currentPage >= paginator.lastPage ? ' disabled' : '' }}">
|
||||
<a class="page-link" href="{{ path(_currentRoute, _currentParams|merge({page: _currentPage + 1})) }}" aria-label="Next">
|
||||
{{ "Next"|trans }} »
|
||||
<a class="page-link px-2.5 py-1 rounded-lg bg-orange-500 align-middle" href="{{ path(_currentRoute, _currentParams|merge({page: _currentPage + 1})) }}" aria-label="Next">
|
||||
»
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
Reference in New Issue
Block a user