-
-
Save BrajeshKhare/68a48eb7fe1f63d8c8e428d6f731e5af to your computer and use it in GitHub Desktop.
News Pagination Template
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{% extends "main.html" %} | |
{% autoescape None %} | |
{% block body %} | |
{% for news_item in news%} | |
<p> | |
<b>{{str(news_item['datetime_added'])}}</b> | |
</p> | |
<p> | |
{{ news_item.get('text', '') }} | |
</p> | |
{% end %} | |
<p> | |
<a href="1">First</a>{% if (currentPage-2) > 1%} | <a href="{{currentPage-2}}">--</a>{% end %} {% if (currentPage-1) > 1 %} | <a href="{{currentPage-1}}">-</a>{% end %} | {{currentPage}} {% if (currentPage + 1) < totalPages %} | <a href="{{currentPage + 1}}">+</a> {% end %} {% if (currentPage + 2) < totalPages %}| <a href="{{currentPage + 2}}">++</a> {% end %}| <a href="{{totalPages +1}}">Last</a> | |
</p> | |
{% end %} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment