forked from I2P_Developers/i2p.www
Implemented pagination for meetings and blog entries
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
{%- else -%}{{ url_for('site_show', lang=g.lang) }}
|
||||
{%- endif -%}
|
||||
{%- endmacro -%}
|
||||
|
||||
{%- macro change_lang(lang) -%}
|
||||
{%- if request.endpoint == 'site_show' -%}{{ url_for('site_show', lang=lang, page=page) }}
|
||||
{%- elif request.endpoint == 'blog_entry' -%}{{ url_for('blog_entry', lang=lang, slug=slug) }}
|
||||
@@ -12,8 +13,33 @@
|
||||
{%- else -%}{{ url_for('site_show', lang=lang) }}
|
||||
{%- endif -%}
|
||||
{%- endmacro -%}
|
||||
|
||||
{%- macro ver(string=None) -%}
|
||||
{%- if string -%}{{ string % '0.9.3' }}
|
||||
{%- else -%}{{ '0.9.3' }}
|
||||
{%- endif -%}
|
||||
{%- endmacro -%}
|
||||
|
||||
{%- macro render_pagination(pagination) %}
|
||||
<div class="pagination">
|
||||
{%- if pagination.has_prev %}
|
||||
<a href="{{ url_for_other_page(pagination.page - 1)
|
||||
}}">« Previous</a>
|
||||
{%- endif %}
|
||||
{%- for page in pagination.iter_pages() %}
|
||||
{%- if page %}
|
||||
{%- if page != pagination.page %}
|
||||
<a href="{{ url_for_other_page(page) }}">{{ page }}</a>
|
||||
{%- else %}
|
||||
<strong>{{ page }}</strong>
|
||||
{%- endif %}
|
||||
{%- else %}
|
||||
<span class="ellipsis">…</span>
|
||||
{%- endif %}
|
||||
{%- endfor %}
|
||||
{%- if pagination.has_next %}
|
||||
<a href="{{ url_for_other_page(pagination.page + 1)
|
||||
}}">Next »</a>
|
||||
{%- endif %}
|
||||
</div>
|
||||
{%- endmacro -%}
|
||||
|
Reference in New Issue
Block a user