Add pagination to page admin
- Update blog link in bit-badger theme
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
<h2 class="my-3">{{ page_title }}</h2>
|
||||
<article>
|
||||
<a href="{{ "admin/page/new/edit" | relative_link }}" class="btn btn-primary btn-sm mb-3">Create a New Page</a>
|
||||
{%- assign page_count = pages | size -%}
|
||||
<table class="table table-sm table-hover">
|
||||
<thead>
|
||||
<tr>
|
||||
@@ -10,7 +11,6 @@
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{%- assign page_count = pages | size -%}
|
||||
{% if page_count > 0 %}
|
||||
{% for pg in pages -%}
|
||||
<tr>
|
||||
@@ -43,6 +43,22 @@
|
||||
{% endif %}
|
||||
</tbody>
|
||||
</table>
|
||||
{% if page_nbr > 1 or page_count == 25 %}
|
||||
<div class="d-flex justify-content-evenly">
|
||||
<div>
|
||||
{% if page_nbr > 1 %}
|
||||
{%- capture prev_link %}admin/pages{{ prev_page }}{% endcapture -%}
|
||||
<p><a class="btn btn-default" href="{{ prev_link | relative_link }}">« Previous</a></p>
|
||||
{% endif %}
|
||||
</div>
|
||||
<div class="text-right">
|
||||
{% if page_count == 25 %}
|
||||
{%- capture next_link %}admin/pages{{ next_page }}{% endcapture -%}
|
||||
<p><a class="btn btn-default" href="{{ next_link | relative_link }}">Next »</a></p>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
<form method="post" id="deleteForm">
|
||||
<input type="hidden" name="{{ csrf.form_field_name }}" value="{{ csrf.request_token }}">
|
||||
</form>
|
||||
|
||||
Reference in New Issue
Block a user