Show per-page selector only when results are present

This commit is contained in:
jeremystretch 2021-12-15 09:46:59 -05:00
parent fee2ac2ebd
commit 3699f16848
2 changed files with 29 additions and 29 deletions

View File

@ -31,6 +31,7 @@
</div> </div>
<div class="col col-md-6 mb-0 text-end"> <div class="col col-md-6 mb-0 text-end">
{# Per-page count selector #} {# Per-page count selector #}
{% if page %}
<div class="dropdown dropup"> <div class="dropdown dropup">
<button class="btn btn-sm btn-outline-secondary dropdown-toggle" type="button" data-bs-toggle="dropdown"> <button class="btn btn-sm btn-outline-secondary dropdown-toggle" type="button" data-bs-toggle="dropdown">
Per Page Per Page
@ -43,7 +44,6 @@
{% endfor %} {% endfor %}
</ul> </ul>
</div> </div>
{% if page %}
<small class="text-end text-muted"> <small class="text-end text-muted">
Showing {{ page.start_index }}-{{ page.end_index }} of {{ page.paginator.count }} Showing {{ page.start_index }}-{{ page.end_index }} of {{ page.paginator.count }}
</small> </small>

View File

@ -46,6 +46,7 @@
</div> </div>
<div class="col col-md-6 mb-0 text-end"> <div class="col col-md-6 mb-0 text-end">
{# Per-page count selector #} {# Per-page count selector #}
{% if page %}
<div class="dropdown dropup"> <div class="dropdown dropup">
<button class="btn btn-sm btn-outline-secondary dropdown-toggle" type="button" data-bs-toggle="dropdown"> <button class="btn btn-sm btn-outline-secondary dropdown-toggle" type="button" data-bs-toggle="dropdown">
Per Page Per Page
@ -63,7 +64,6 @@
{% endfor %} {% endfor %}
</ul> </ul>
</div> </div>
{% if page %}
<small class="text-end text-muted"> <small class="text-end text-muted">
Showing {{ page.start_index }}-{{ page.end_index }} of {{ page.paginator.count }} Showing {{ page.start_index }}-{{ page.end_index }} of {{ page.paginator.count }}
</small> </small>