Don't show abstract on articles list

This commit is contained in:
Gabriel Augendre 2020-11-24 21:54:42 +01:00
parent 1f91b76837
commit 7f64b9d05f
No known key found for this signature in database
GPG key ID: 1E693F4CE4AEE7B4
2 changed files with 11 additions and 9 deletions

View file

@ -6,16 +6,20 @@
{% block content %} {% block content %}
<h1>{{ blog_title }}{% if title %} &middot; {{ title }}{% endif %}</h1> <h1>{{ blog_title }}{% if title %} &middot; {{ title }}{% endif %}</h1>
<p class="metadata">{{ blog_description }}</p> <p class="metadata">{{ blog_description }}</p>
<ul>
{% for article in articles %} {% for article in articles %}
<article class="article-list"> <li>
<h2><a href="{% url 'article-detail' slug=article.slug %}">{{ article.title }}</a></h2> {% if article.published_at %}
{% include "articles/metadata_snippet.html" %} <time datetime="{{ article.published_at|date:CUSTOM_ISO }}">{{ article.published_at|date }}</time>
{{ article.get_abstract|safe }} {% else %}
<p class="read-more"><a href="{% url 'article-detail' slug=article.slug %}">Read more...</a></p> <time datetime="{{ article.updated_at|date:CUSTOM_ISO }}">{{ article.updated_at|date }}</time>
</article> {% endif %}
: <a href="{% url 'article-detail' slug=article.slug %}">{{ article.title }}</a>
</li>
{% empty %} {% empty %}
<p>No article here. Come back later 🙂</p> <li>No article here. Come back later 🙂</li>
{% endfor %} {% endfor %}
</ul>
<nav class="pagination"> <nav class="pagination">
<div class="older"> <div class="older">
{% if page_obj.has_next %} {% if page_obj.has_next %}

View file

@ -9,8 +9,6 @@ from articles.models import Article, Page
class BaseArticleListView(generic.ListView): class BaseArticleListView(generic.ListView):
paginate_by = 15
def get_context_data(self, **kwargs): def get_context_data(self, **kwargs):
context = super().get_context_data(**kwargs) context = super().get_context_data(**kwargs)
context["blog_title"] = settings.BLOG["title"] context["blog_title"] = settings.BLOG["title"]