From 963d4138472e9b5b5bb1b8d386be91ae7695bc94 Mon Sep 17 00:00:00 2001 From: Bat Date: Thu, 24 May 2018 10:49:02 +0100 Subject: [PATCH] Don't show reshares or posts on profile if there are none --- templates/users/details.tera | 28 ++++++++++++++++------------ 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/templates/users/details.tera b/templates/users/details.tera index 33982214..d225a300 100644 --- a/templates/users/details.tera +++ b/templates/users/details.tera @@ -31,17 +31,21 @@ {{ user.summary | safe }} -

Latest articles

-
- {% for article in recents %} - {{ macros::post_card(article=article) }} - {% endfor %} -
+ {% if recents | length != 0 %} +

Latest articles

+
+ {% for article in recents %} + {{ macros::post_card(article=article) }} + {% endfor %} +
+ {% endif %} -

Recently reshared

-
- {% for article in reshares %} - {{ macros::post_card(article=article) }} - {% endfor %} -
+ {% if reshares | length != 0 %} +

Recently reshared

+
+ {% for article in reshares %} + {{ macros::post_card(article=article) }} + {% endfor %} +
+ {% endif %} {% endblock content %}