From 58b6478e4797d2aae35871badc7ea0ad6f745d54 Mon Sep 17 00:00:00 2001 From: Zankaria Date: Fri, 10 Oct 2025 23:46:38 +0200 Subject: [PATCH] fileinfo.html: do not generate file related html if there are no files --- templates/post/fileinfo.html | 60 ++++++++++++++++++------------------ 1 file changed, 30 insertions(+), 30 deletions(-) diff --git a/templates/post/fileinfo.html b/templates/post/fileinfo.html index a2384fe9..c1356176 100644 --- a/templates/post/fileinfo.html +++ b/templates/post/fileinfo.html @@ -1,37 +1,37 @@ - {% if post.embed %} - {{ post.embed }} - {% else %} +{% if post.embed %} + {{ post.embed }} +{% elseif post.num_files > 0 %}
{% for file in post.files %}
- {% if file.file == 'deleted' %} - - {% else %} -

File: {{ file.file }} - ( - {% if file.thumb == 'spoiler' %} - {% trans %}Spoiler Image{% endtrans %}, - {% endif %} - {{ file.size|filesize }} - {% if file.width and file.height %} - , {{ file.width}}x{{ file.height }} - {% if config.show_ratio %} - , {{ ratio(file.width, file.height) }} + {% if file.file == 'deleted' %} + + {% else %} +

File: {{ file.file }} + ( + {% if file.thumb == 'spoiler' %} + {% trans %}Spoiler Image{% endtrans %}, {% endif %} - {% endif %} - {% if config.show_filename and file.filename %} - , {% if file.filename|length > config.max_filename_display %} - {{ file.filename|truncate_filename(config.max_filename_display)|e|bidi_cleanup }} - {% else %} - {{ file.filename|e|bidi_cleanup }} + {{ file.size|filesize }} + {% if file.width and file.height %} + , {{ file.width}}x{{ file.height }} + {% if config.show_ratio %} + , {{ ratio(file.width, file.height) }} + {% endif %} {% endif %} - {% endif %} - ) - {% include "post/image_identification.html" %} - {% include "post/file_controls.html" %}

- {% include "post/image.html" with {'post':file} %} - {% endif %} -
+ {% if config.show_filename and file.filename %} + , {% if file.filename|length > config.max_filename_display %} + {{ file.filename|truncate_filename(config.max_filename_display)|e|bidi_cleanup }} + {% else %} + {{ file.filename|e|bidi_cleanup }} + {% endif %} + {% endif %} + ) + {% include "post/image_identification.html" %} + {% include "post/file_controls.html" %}

+ {% include "post/image.html" with {'post':file} %} + {% endif %} +
{% endfor %} - {% endif %} +{% endif %}