41 lines
1.1 KiB
HTML
41 lines
1.1 KiB
HTML
{% extends "base.html" %}
|
|
|
|
{% block title %}Blog Posts{% endblock %}
|
|
|
|
{% block content %}
|
|
<div class="row">
|
|
<div class="col-sm-8">
|
|
{% for post in posts %}
|
|
<a href="{{ post.get_absolute_url }}"><h1>{{ post.title }}</h1></a>
|
|
<p>Published: {{ post.published_date }}</p>
|
|
<p>{{ post.description }}</p>
|
|
{% endfor %}
|
|
|
|
{% if posts.num_pages > 1 %}
|
|
<div class="pagination">
|
|
<span class="step-links">
|
|
{% if contacts.has_previous %}
|
|
<a href="?page={{ posts.previous_page_number }}">previous</a>
|
|
{% endif %}
|
|
|
|
<span class="current">
|
|
Page {{ posts.number }} of {{ posts.paginator.num_pages }}.
|
|
</span>
|
|
|
|
{% if contacts.has_next %}
|
|
<a href="?page={{ posts.next_page_number }}">next</a>
|
|
{% endif %}
|
|
</span>
|
|
</div>
|
|
{% endif %}
|
|
</div>
|
|
<div class="col-sm-3 offset-sm-1">
|
|
<ul class="list-group">
|
|
{% for category in categories %}
|
|
<a href="{{ category.get_absolute_url }}" class="list-group-item list-group-item-action">{{ category.name }}</a>
|
|
{% endfor %}
|
|
</ul>
|
|
</div>
|
|
</div>
|
|
{% endblock content %}
|