Created
November 16, 2012 07:45
-
-
Save econchick/4085203 to your computer and use it in GitHub Desktop.
templates/blog/list.html
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 "base.html" %} | |
{% block content %} | |
<div class="main"> | |
<!-- Posts --> | |
<ul> | |
{% for post in posts.object_list %} | |
<div class="title">{{ post.title }}</div> | |
<ul> | |
<div class="time">{{ post.created }}</div> | |
<div class="body">{{ post.body|truncatewords:50 }}</div> | |
<div class="commentlink"><a href="{% url post post.pk %}">More</a></div> | |
</ul> | |
<br /> | |
{% endfor %} | |
</ul> | |
<!-- Next/Prev page links --> | |
{% if posts.object_list and posts.paginator.num_pages > 1 %} | |
<div class="pagination" style="margin-top: 20px; margin-left: -20px; "> | |
<span class="step-links"> | |
{% if posts.has_previous %} | |
<a href= "?page={{ posts.previous_page_number }}">newer entries << </a> | |
{% endif %} | |
<span class="current"> | |
Page {{ posts.number }} of {{ posts.paginator.num_pages }} | |
</span> | |
{% if posts.has_next %} | |
<a href="?page={{ posts.next_page_number }}"> >> older entries</a> | |
{% endif %} | |
</span> | |
</div> | |
{% endif %} | |
</div> | |
{% endblock %} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment