This repository has been archived on 2023-05-31. You can view files and clone it, but cannot push or open issues or pull requests.
python-blog/articles/templates/articles/article_list.html

30 lines
1 KiB
HTML

{% extends 'articles/base.html' %}
{% block title %}
{{ title }}
{% endblock %}
{% block content %}
<h1>{{ title }} list</h1>
{% for article in articles %}
<article class="article-list">
<h2><a href="{% url 'article-detail' slug=article.slug %}">{{ article.title }}</a></h2>
{% include "articles/metadata_snippet.html" %}
<p>{{ article.get_abstract|safe }}</p>
<p class="read-more"><a href="{% url 'article-detail' slug=article.slug %}">Read more...</a></p>
</article>
{% empty %}
<p>No article here. Come back later 🙂</p>
{% endfor %}
<nav class="pagination">
<div class="older">
{% if page_obj.has_next %}
<a href="?page={{ page_obj.next_page_number }}">⇠ Older</a>
{% endif %}
</div>
<div class="newer">
{% if page_obj.has_previous %}
<a href="?page={{ page_obj.previous_page_number }}">Newer ⇢</a>
{% endif %}
</div>
</nav>
{% endblock %}