From 042e7b9c598975f876d8a86c8e4242dbf17f7bdf Mon Sep 17 00:00:00 2001
From: Fredrick Brennan
Date: Wed, 30 Apr 2014 17:18:35 -0400
Subject: Deprecate postControls(), per-file deletion and spoilering
---
templates/post/file_controls.html | 10 +++++++
templates/post/fileinfo.html | 2 +-
templates/post/post_controls.html | 57 +++++++++++++++++++++++++++++++++++++++
templates/post_reply.html | 4 +--
templates/post_thread.html | 2 +-
5 files changed, 71 insertions(+), 4 deletions(-)
create mode 100644 templates/post/file_controls.html
create mode 100644 templates/post/post_controls.html
(limited to 'templates')
diff --git a/templates/post/file_controls.html b/templates/post/file_controls.html
new file mode 100644
index 00000000..6855a293
--- /dev/null
+++ b/templates/post/file_controls.html
@@ -0,0 +1,10 @@
+{% if post.files and mod %}
+
+{% if file.file != 'deleted' and mod|hasPermission(config.mod.deletefile, board.uri) %}
+{{ secure_link_confirm(config.mod.link_deletefile, 'Delete file'|trans, 'Are you sure you want to delete this file?'|trans, board.dir ~ 'deletefile/' ~ post.id ~ '/' ~ loop.index0 ) }}
+{% endif %}
+{% if file.file and file.file != 'deleted' and file.thumb != 'spoiler' and mod|hasPermission(config.mod.spoilerimage, board.uri) %}
+{{ secure_link_confirm(config.mod.link_spoilerimage, 'Spoiler file'|trans, 'Are you sure you want to spoiler this file?'|trans, board.dir ~ 'spoiler/' ~ post.id ~ '/' ~ loop.index0 ) }}
+{% endif %}
+
+{% endif %}
diff --git a/templates/post/fileinfo.html b/templates/post/fileinfo.html
index add7fd0c..dcbb249d 100644
--- a/templates/post/fileinfo.html
+++ b/templates/post/fileinfo.html
@@ -29,7 +29,7 @@
{% endif %}
{% include "post/image_identification.html" %}
)
-
+ {% include "post/file_controls.html" %}
{% include "post/image.html" with {'post':file} %}
{% endif %}
diff --git a/templates/post/post_controls.html b/templates/post/post_controls.html
new file mode 100644
index 00000000..78ee5842
--- /dev/null
+++ b/templates/post/post_controls.html
@@ -0,0 +1,57 @@
+{% if mod %}
+
+ 1 %}style="clear:both"{% endif %}>
{% endfilter %}{% if index %}{{ post.body|truncate_body(post.link) }}{% else %}{{ post.body }}{% endif %}{% filter remove_whitespace %}
{% if post.modifiers['ban message'] %}
diff --git a/templates/post_thread.html b/templates/post_thread.html
index a5bf8e08..335c1713 100644
--- a/templates/post_thread.html
+++ b/templates/post_thread.html
@@ -48,7 +48,7 @@
{% set lastcount = config.noko50_count %}
[{% trans %}Last 1 Post{% plural lastcount %}Last {{ count }} Posts{% endtrans %}]
{% endif %}
- {{ post.postControls }}
+ {% include 'post/post_controls.html' %}
{% endfilter %}{% if index %}{{ post.body|truncate_body(post.link) }}{% else %}{{ post.body }}{% endif %}{% filter remove_whitespace %}
--
cgit v1.3