diff --git a/articles/templates/articles/article_detail.html b/articles/templates/articles/article_detail.html index fd4d307..a6f3ad7 100644 --- a/articles/templates/articles/article_detail.html +++ b/articles/templates/articles/article_detail.html @@ -2,11 +2,8 @@ {% block content %}
-

{{ article.title }}

-

By: {{ article.author }}

-

Published at: {{ article.published_at }}

-

Updated at: {{ article.updated_at }}

- +

{{ article.title }}{% if article.status != article.PUBLISHED %} ({{ article.status }}){% endif %}

+ {% include "articles/date_snippet.html" %}
{{ article.get_formatted_content|safe }}
diff --git a/articles/templates/articles/article_list.html b/articles/templates/articles/article_list.html index 6e4b75b..2468802 100644 --- a/articles/templates/articles/article_list.html +++ b/articles/templates/articles/article_list.html @@ -4,9 +4,10 @@

{{ title }} list

{% for article in articles %}
-

{{ article.title }}

-

{{ article.get_abstract|safe }}

-

Read more

+

{{ article.title }}

+ {% include "articles/date_snippet.html" %} +

{{ article.get_abstract|safe }}

+

Read more

{% empty %}

No article here. Come back later 🙂

diff --git a/articles/templates/articles/date_snippet.html b/articles/templates/articles/date_snippet.html new file mode 100644 index 0000000..75d2c5c --- /dev/null +++ b/articles/templates/articles/date_snippet.html @@ -0,0 +1,7 @@ +

+ {% if article.published_at %} + {{ article.published_at|date }} + {% else %} + {{ article.updated_at|date }} + {% endif %} +