From e81ce17fb4fdb6215d942005c10db32f4bafa6d5 Mon Sep 17 00:00:00 2001 From: czaks Date: Wed, 16 Apr 2014 11:54:41 +0200 Subject: [PATCH] modularize post templates a little bit; try to unify duplicate code --- templates/post_reply.html | 65 ++++------------------------------------------ templates/post_thread.html | 59 +++-------------------------------------- 2 files changed, 8 insertions(+), 116 deletions(-) diff --git a/templates/post_reply.html b/templates/post_reply.html index bdac289d..530d2626 100644 --- a/templates/post_reply.html +++ b/templates/post_reply.html @@ -28,21 +28,7 @@ {% if post.mod and post.mod|hasPermission(config.mod.show_ip, board.uri) %} [{{ post.ip }}] {% endif %} - {% if config.display_flags and post.modifiers.flag %} - {{ post.modifiers['flag alt'] | e('html_attr') }} - {% endif %} + {% include 'post/flag.html' %} {% if config.poster_ids %} @@ -61,7 +47,7 @@

File: {{ post.file }} ( {% if post.thumb == 'spoiler' %} - Spoiler Image, + {% trans %}Spoiler Image{% endtrans %}, {% endif %} {{ post.filesize|filesize }} {% if post.filewidth and post.fileheight %} @@ -78,51 +64,10 @@ {{ post.filename|e|bidi_cleanup }} {% endif %} {% endif %} - {% if post.thumb != 'file' and config.image_identification %} - , - - io - {% if post.file|extension == 'jpg' %} - e - {% endif %} - g - t - - {% endif %} - + {% include "post/image_identification.html" %} ) - -

- - {% if post.thumb|extension == 'webm' %} - - {% else %} - - {% endif %} - +

+ {% include "post/image.html" %} {% endif %} {{ post.postControls }}
diff --git a/templates/post_thread.html b/templates/post_thread.html index fdf6369a..acacd602 100644 --- a/templates/post_thread.html +++ b/templates/post_thread.html @@ -28,49 +28,10 @@ {{ post.filename|e|bidi_cleanup }} {% endif %} {% endif %} - {% if post.thumb != 'file' and config.image_identification %} - , - - io - {% if post.file|extension == 'jpg' %} - e - {% endif %} - g - t - - {% endif %} + {% include "post/image_identification.html" %} )

- - {% if post.thumb|extension == 'webm' %} - - {% else %} - - {% endif %} - + {% include "post/image.html" %} {% endif %}

@@ -98,21 +59,7 @@ {% if post.mod and post.mod|hasPermission(config.mod.show_ip, board.uri) %} [{{ post.ip }}] {% endif %} - {% if config.display_flags and post.modifiers.flag %} - {{ post.modifiers['flag alt'] | e('html_attr') }} - {% endif %} + {% include 'post/flag.html' %} {% if config.poster_ids %}