added pagination macro
This commit is contained in:
parent
fc28212ce0
commit
6b2d3fa439
@ -271,6 +271,7 @@ db_migrate() {
|
|||||||
db_upgrade() {
|
db_upgrade() {
|
||||||
shift
|
shift
|
||||||
source venv/bin/activate
|
source venv/bin/activate
|
||||||
|
mkdir -p data
|
||||||
python manager.py db upgrade
|
python manager.py db upgrade
|
||||||
}
|
}
|
||||||
|
|
||||||
|
15
oshipka/webapp/templates/_macros.html
Normal file
15
oshipka/webapp/templates/_macros.html
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
{% macro render_pagination(pagination, endpoint) %}
|
||||||
|
<div class="pagination">
|
||||||
|
{%- for page in pagination.iter_pages() %}
|
||||||
|
{% if page %}
|
||||||
|
{% if page != pagination.page %}
|
||||||
|
<a href="{{ url_for(endpoint, page=page) }}">{{ page }}</a>
|
||||||
|
{% else %}
|
||||||
|
<strong>{{ page }}</strong>
|
||||||
|
{% endif %}
|
||||||
|
{% else %}
|
||||||
|
<span class="ellipsis">…</span>
|
||||||
|
{% endif %}
|
||||||
|
{%- endfor %}
|
||||||
|
</div>
|
||||||
|
{% endmacro %}
|
Loading…
Reference in New Issue
Block a user