Make the history view pagination prettier.
This commit is contained in:
parent
35471d3c3f
commit
242e317e65
2 changed files with 27 additions and 21 deletions
|
@ -15,6 +15,27 @@
|
|||
<th>Date</th>
|
||||
</tr>
|
||||
</thead>
|
||||
{% if pagination.page > 1 or pagination.more %}
|
||||
<tfoot>
|
||||
<tr><td colspan="4">
|
||||
<ul class="pagination" style="float: right">
|
||||
<li class="paginate_button previous{% if pagination.page == 1 %} disabled{% endif %}">
|
||||
<a href="{{ url_for('.history', name=name, page=pagination.page - 1) }}">Previous</a>
|
||||
</li>
|
||||
{% for p in range(1, pagination.page + 1) %}
|
||||
<li class="paginate_button{% if p == pagination.page %} active{% endif %}">
|
||||
<a href="{{ url_for('.history', name=name, page=p) }}">{{ p }}</a>
|
||||
</li>
|
||||
{% endfor %}
|
||||
{% if pagination.more %}<li class="paginate_button disabled"><a>…</a></li>{% endif %}
|
||||
<li class="paginate_button next{% if not pagination.more %} disabled{% endif %}">
|
||||
<a href="{{ url_for('.history', name=name, page=pagination.page + 1) }}">Next</a>
|
||||
</li>
|
||||
</ul>
|
||||
</td></tr>
|
||||
</tfoot>
|
||||
{% endif %}
|
||||
<tbody>
|
||||
{% for h in history %}
|
||||
<tr>
|
||||
<td class="checkbox-cell text-center">
|
||||
|
@ -27,23 +48,8 @@
|
|||
<td>{{ h.time|datetime }}</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
<!-- TODO: make this pagination look good -->
|
||||
{% if pagination.page > 1 or pagination.more %}
|
||||
<div>
|
||||
{% if pagination.page > 1 %}
|
||||
<a href="{{ url_for('.history', name=name, page=pagination.page - 1) }}"><</a>
|
||||
{% else %}
|
||||
<
|
||||
{% endif %}
|
||||
{{ pagination.page }}
|
||||
{% if pagination.more %}
|
||||
<a href="{{ url_for('.history', name=name, page=pagination.page + 1) }}">></a>
|
||||
{% else %}
|
||||
>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endif %}
|
||||
<p>
|
||||
<a class="btn btn-default btn-sm compare-revisions">Compare Revisions</a>
|
||||
</p>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue