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 %} + + +{% if mod|hasPermission(config.mod.delete, board.uri) %} + {{ secure_link_confirm(config.mod.link_delete, 'Delete'|trans, 'Are you sure you want to delete this?'|trans, board.dir ~ 'delete/' ~ post.id) }}  +{% endif %} +{% if mod|hasPermission(config.mod.deletebyip, board.uri) %} + {{ secure_link_confirm(config.mod.link_deletebyip, 'Delete all posts by IP'|trans, 'Are you sure you want to delete all posts by this IP address?'|trans, board.dir ~ 'deletebyip/' ~ post.id) }}  +{% endif %} +{% if mod|hasPermission(config.mod.deletebyip_global, board.uri) %} + {{ secure_link_confirm(config.mod.link_deletebyip_global, 'Delete all posts by IP across all boards'|trans, 'Are you sure you want to delete all posts by this IP address, across all boards?'|trans, board.dir ~ 'deletebyip/' ~ post.id ~ '/global') }}  +{% endif %} +{% if mod|hasPermission(config.mod.ban, board.uri) %} + {{ config.mod.link_ban }}  +{% endif %} +{% if mod|hasPermission(config.mod.bandelete, board.uri) %} + {{ config.mod.link_bandelete }}  +{% endif %} + +{% if not post.thread %} +{% if mod|hasPermission(config.mod.sticky, board.uri) %} + {% if post.sticky %} + {{ config.mod.link_desticky }}  + {% else %} + {{ config.mod.link_sticky }}  + {% endif %} +{% endif %} +{% if mod|hasPermission(config.mod.bumplock, board.uri) %} + {% if post.sage %} + {{ config.mod.link_bumpunlock }}  + {% else %} + {{ config.mod.link_bumplock }}  + {% endif %} +{% endif %} +{% if mod|hasPermission(config.mod.lock, board.uri) %} + {% if post.locked %} + {{ config.mod.link_unlock }}  + {% else %} + {{ config.mod.link_lock }}  + {% endif %} +{% endif %} + +{% endif %} + +{% if mod|hasPermission(config.mod.move, board.uri) %} + {% if not post.thread %} + {{ config.mod.link_move }}  + {% else %} + {{ config.mod.link_move }}  + {% endif %} +{% if mod|hasPermission(config.mod.editpost, board.uri) %} + {{ config.mod.link_editpost }}  +{% endif %} +{% endif %} + + +{% endif %} diff --git a/templates/post_reply.html b/templates/post_reply.html index 3d860872..8ef3c1e8 100644 --- a/templates/post_reply.html +++ b/templates/post_reply.html @@ -17,8 +17,8 @@ {{ post.id }}

- {% include 'post/fileinfo.html' %} - {{ post.postControls }} + {% include 'post/fileinfo.html' %} + {% include 'post/post_controls.html' %}
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