From e034b9179dd2777353c369910e65350d5496b779 Mon Sep 17 00:00:00 2001 From: czaks Date: Sun, 6 Apr 2014 21:48:31 +0200 Subject: fix paths in templates --- templates/post_reply.html | 33 ++++++++++++++++++++++++--------- 1 file changed, 24 insertions(+), 9 deletions(-) (limited to 'templates/post_reply.html') diff --git a/templates/post_reply.html b/templates/post_reply.html index 713ddac9..bdac289d 100644 --- a/templates/post_reply.html +++ b/templates/post_reply.html @@ -93,20 +93,35 @@ )

- - + {% if post.thumb|extension == 'webm' %} + + {% else %} + + {% endif %} {% endif %} {{ post.postControls }} -- cgit v1.3 From e81ce17fb4fdb6215d942005c10db32f4bafa6d5 Mon Sep 17 00:00:00 2001 From: czaks Date: Wed, 16 Apr 2014 11:54:41 +0200 Subject: 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(-) (limited to 'templates/post_reply.html') 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 %} -- cgit v1.3 From 59874b83769259e3a1b0730405e5f65e46243666 Mon Sep 17 00:00:00 2001 From: czaks Date: Wed, 16 Apr 2014 15:01:37 +0200 Subject: modularize post templates a little more --- templates/post/ip.html | 3 +++ templates/post/name.html | 16 ++++++++++++++++ templates/post/poster_id.html | 3 +++ templates/post/subject.html | 5 +++++ templates/post/time.html | 1 + templates/post_reply.html | 33 ++++++--------------------------- templates/post_thread.html | 32 +++++--------------------------- 7 files changed, 39 insertions(+), 54 deletions(-) create mode 100644 templates/post/ip.html create mode 100644 templates/post/name.html create mode 100644 templates/post/poster_id.html create mode 100644 templates/post/subject.html create mode 100644 templates/post/time.html (limited to 'templates/post_reply.html') diff --git a/templates/post/ip.html b/templates/post/ip.html new file mode 100644 index 00000000..11581ff9 --- /dev/null +++ b/templates/post/ip.html @@ -0,0 +1,3 @@ +{% if post.mod and post.mod|hasPermission(config.mod.show_ip, board.uri) %} + [{{ post.ip }}] +{% endif %} diff --git a/templates/post/name.html b/templates/post/name.html new file mode 100644 index 00000000..009b234d --- /dev/null +++ b/templates/post/name.html @@ -0,0 +1,16 @@ +{% set capcode = post.capcode|capcode %} +{% if post.email|length > 0 %} + {# start email #} + +{% endif %} +{% if capcode %} + {{ capcode.cap }} +{% endif %} diff --git a/templates/post/poster_id.html b/templates/post/poster_id.html new file mode 100644 index 00000000..3f168003 --- /dev/null +++ b/templates/post/poster_id.html @@ -0,0 +1,3 @@ +{% if config.poster_ids %} + ID: {{ post.ip|poster_id(post.id) }} +{% endif %} diff --git a/templates/post/subject.html b/templates/post/subject.html new file mode 100644 index 00000000..0d80d95e --- /dev/null +++ b/templates/post/subject.html @@ -0,0 +1,5 @@ +{% if post.subject|length > 0 %} + {# show subject #} + {{ post.subject|bidi_cleanup }} +{% endif %} + diff --git a/templates/post/time.html b/templates/post/time.html new file mode 100644 index 00000000..e6273f94 --- /dev/null +++ b/templates/post/time.html @@ -0,0 +1 @@ + diff --git a/templates/post_reply.html b/templates/post_reply.html index 530d2626..90ac5065 100644 --- a/templates/post_reply.html +++ b/templates/post_reply.html @@ -5,35 +5,14 @@

- {% if config.poster_ids %} - ID: {{ post.ip|poster_id(post.thread) }} - {% endif %} + {% include 'post/poster_id.html' %} + No. {{ post.id }} diff --git a/templates/post_thread.html b/templates/post_thread.html index acacd602..f74427e4 100644 --- a/templates/post_thread.html +++ b/templates/post_thread.html @@ -36,35 +36,13 @@

- {% endif %} - {% if capcode %} - {{ capcode.cap }} - {% endif %} - {% if post.mod and post.mod|hasPermission(config.mod.show_ip, board.uri) %} - [{{ post.ip }}] - {% endif %} + {% include 'post/subject.html' %} + {% include 'post/name.html' %} + {% include 'post/ip.html' %} {% include 'post/flag.html' %} - + {% include 'post/time.html' %} - {% if config.poster_ids %} - ID: {{ post.ip|poster_id(post.id) }} - {% endif %} + {% include 'post/poster_id.html' %} No. {{ post.id }} -- cgit v1.3