-
Notifications
You must be signed in to change notification settings - Fork 253
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #289 from MongoEngine/better-documentation
Better documentation around pagination
- Loading branch information
Showing
8 changed files
with
93 additions
and
7 deletions.
There are no files selected for viewing
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
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
{% extends "layout.html" %} | ||
|
||
{# Macro for creating navigation links #} | ||
{% macro render_navigation(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 %} | ||
|
||
{% block body %} | ||
|
||
<div class="todos"> | ||
<ul> | ||
{% for todo in todos_page.items %} | ||
<li>{{ todo.title }}</li> | ||
{% endfor %} | ||
</ul> | ||
</div> | ||
|
||
<div class="navigation"> | ||
{{ render_navigation(todos_page, 'pagination') }} | ||
</div> | ||
|
||
|
||
{% endblock %} |
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
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
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