Skip to content

Conditionally show first/next and previous/last pagination links on first and last pages (CFM-170) #28

Merged
merged 1 commit into from
May 17, 2022
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
25 changes: 12 additions & 13 deletions app/templates/element/pagination.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,22 +36,21 @@
</span>
<?php if($this->Paginator->hasPage(2)): ?>
<!-- show the pagination elements if there is more than 1 page -->
<ul class="paginationFirst">
<?= $this->Paginator->first(__d('operation', 'first')); ?>
</ul>
<ul class="paginationPrev">
<?= $this->Paginator->prev(__d('operation', 'previous'), ['class' => 'disabled']); ?>
</ul>
<?php if($this->Paginator->hasPrev()): ?>
<ul class="paginationFirstPrev">
<?= $this->Paginator->first(__d('operation', 'first')); ?>
<?= $this->Paginator->prev(__d('operation', 'previous'), ['class' => 'disabled']); ?>
</ul>
<?php endif; ?>
<ul class="paginationNumbers">
<?= $this->Paginator->numbers(); ?>
</ul>
<ul class="paginationNext">
<?= $this->Paginator->next(__d('operation', 'next'), ['class' => 'disabled']); ?>
</ul>
<ul class="paginationLast">
<?= $this->Paginator->last(__d('operation', 'last')); ?>
</ul>

<?php if($this->Paginator->hasNext()): ?>
<ul class="paginationNextLast">
<?= $this->Paginator->next(__d('operation', 'next'), ['class' => 'disabled']); ?>
<?= $this->Paginator->last(__d('operation', 'last')); ?>
</ul>
<?php endif; ?>
<form id="goto-page"
class="pagination-form"
method="get"
Expand Down
6 changes: 2 additions & 4 deletions app/webroot/css/co-base.css
Original file line number Diff line number Diff line change
Expand Up @@ -851,13 +851,11 @@ th.actions {
#pagination .paginationCounter {
display: block;
}
#pagination .paginationFirst,
#pagination .paginationPrev {
#pagination ul.paginationFirstPrev li {
margin-right: 0.5em;
font-size: 0.9em;
}
#pagination .paginationLast,
#pagination .paginationNext {
#pagination ul.paginationNextLast li {
margin-left: 0.5em;
font-size: 0.9em;
}
Expand Down