From e3aaba8483692fb00beeef99a04f0ed5c86ba23c Mon Sep 17 00:00:00 2001 From: "Antonio J. Delgado" Date: Tue, 3 Sep 2024 13:20:58 +0300 Subject: [PATCH] Add default media object to template --- templates/new_post.html.j2 | 56 ++++++++++++++++++++------------------ 1 file changed, 30 insertions(+), 26 deletions(-) diff --git a/templates/new_post.html.j2 b/templates/new_post.html.j2 index 5e209ca..213d2b4 100644 --- a/templates/new_post.html.j2 +++ b/templates/new_post.html.j2 @@ -67,19 +67,21 @@ {{ data['content'] }} {% if data['media_attachments'] %} - {% for media in data['media_attachments'] %} - {% if media['type'] == 'image' -%} - {{ media['description'] }} - {% elif media['type'] == 'video' or media['type'] == 'gifv' -%} - - {% elif media['type'] == 'audio' -%} - - Download audio - {%- endif %} - {% endfor %} + {% for media in data['media_attachments'] %} + {% if media['type'] == 'image' -%} + {{ media['description'] }} + {% elif media['type'] == 'video' or media['type'] == 'gifv' -%} + + {% elif media['type'] == 'audio' -%} + + Download audio + {% else %} + + {%- endif %} + {% endfor %} {% endif %} {% if data['meb_reply_to'] %} {% for reply in data['meb_reply_to'] %} @@ -118,19 +120,21 @@ {{ reply['content'] }} {% if reply['media_attachments'] %} - {% for media in reply['media_attachments'] %} - {% if media['type'] == 'image' %} - {{ media['description'] }} - {% elif media['type'] == 'video' %} - - {% elif media['type'] == 'audio' %} - - Download audio - {% endif %} - {% endfor %} + {% for media in reply['media_attachments'] %} + {% if media['type'] == 'image' %} + {{ media['description'] }} + {% elif media['type'] == 'video' %} + + {% elif media['type'] == 'audio' %} + + Download audio + {% else %} + + {% endif %} + {% endfor %} {% endif %}