diff options
| author | Fredrick Brennan <admin@8chan.co> | 2014-04-30 17:18:35 -0400 |
|---|---|---|
| committer | Fredrick Brennan <admin@8chan.co> | 2014-04-30 17:18:35 -0400 |
| commit | 042e7b9c598975f876d8a86c8e4242dbf17f7bdf (patch) | |
| tree | bbe80de76afd68dd3674a85feac7bb593836a4f3 /templates | |
| parent | 400df0975fc6eb0570ed65706dadc81281f5dc75 (diff) | |
Deprecate postControls(), per-file deletion and spoilering
Diffstat (limited to 'templates')
| -rw-r--r-- | templates/post/file_controls.html | 10 | ||||
| -rw-r--r-- | templates/post/fileinfo.html | 2 | ||||
| -rw-r--r-- | templates/post/post_controls.html | 57 | ||||
| -rw-r--r-- | templates/post_reply.html | 4 | ||||
| -rw-r--r-- | templates/post_thread.html | 2 |
5 files changed, 71 insertions, 4 deletions
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 %} +<span class="controls"> +{% 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 %} +</span> +{% 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" %} ) - </span></p> + </span> {% include "post/file_controls.html" %}</p> {% include "post/image.html" with {'post':file} %} {% endif %} </div> 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 %} + +<span class="controls {% if not post.thread %}op{% endif %}"> +{% 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) %} + <a title="{% trans %}Ban{% endtrans %}" href="?/{{ board.dir }}ban/{{ post.id }}">{{ config.mod.link_ban }}</a> +{% endif %} +{% if mod|hasPermission(config.mod.bandelete, board.uri) %} + <a title="{% trans %}Ban & Delete{% endtrans %}" href="?/{{ board.dir }}ban&delete/{{ post.id }}">{{ config.mod.link_bandelete }}</a> +{% endif %} + +{% if not post.thread %} +{% if mod|hasPermission(config.mod.sticky, board.uri) %} + {% if post.sticky %} + <a title="{% trans %}Make thread not sticky{% endtrans %}" href="?/{{ secure_link(board.dir ~ 'unsticky/' ~ post.id) }}">{{ config.mod.link_desticky }}</a> + {% else %} + <a title="{% trans %}Make thread sticky{% endtrans %}" href="?/{{ secure_link(board.dir ~ 'sticky/' ~ post.id) }}">{{ config.mod.link_sticky }}</a> + {% endif %} +{% endif %} +{% if mod|hasPermission(config.mod.bumplock, board.uri) %} + {% if post.sage %} + <a title="{% trans %}Allow thread to be bumped{% endtrans %}" href="?/{{ secure_link(board.dir ~ 'bumpunlock/' ~ post.id) }}">{{ config.mod.link_bumpunlock }}</a> + {% else %} + <a title="{% trans %}Prevent thread from being bumped{% endtrans %}" href="?/{{ secure_link(board.dir ~ 'bumplock/' ~ post.id) }}">{{ config.mod.link_bumplock }}</a> + {% endif %} +{% endif %} +{% if mod|hasPermission(config.mod.lock, board.uri) %} + {% if post.locked %} + <a title="{% trans %}Unlock thread{% endtrans %}" href="?/{{ secure_link(board.dir ~ 'unlock/' ~ post.id) }}">{{ config.mod.link_unlock }}</a> + {% else %} + <a title="{% trans %}Lock thread{% endtrans %}" href="?/{{ secure_link(board.dir ~ 'lock/' ~ post.id) }}">{{ config.mod.link_lock }}</a> + {% endif %} +{% endif %} + +{% endif %} + +{% if mod|hasPermission(config.mod.move, board.uri) %} + {% if not post.thread %} + <a title="{% trans %}Move thread to another board{% endtrans %}" href="?/{{ board.dir }}move/{{ post.id }}">{{ config.mod.link_move }}</a> + {% else %} + <a title="{% trans %}Move reply to another board{% endtrans %}" href="?/{{ board.dir }}move_reply/{{ post.id }}">{{ config.mod.link_move }}</a> + {% endif %} +{% if mod|hasPermission(config.mod.editpost, board.uri) %} + <a title="{% trans %}Edit post{% endtrans %}" href="?/{{ board.dir }}edit{% if config.mod.raw_html_default %}_raw{% endif %}/{{ post.id }}">{{ config.mod.link_editpost }}</a> +{% endif %} +{% endif %} +</span> + +{% 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 }} </a> </p> - {% include 'post/fileinfo.html' %} - {{ post.postControls }} + {% include 'post/fileinfo.html' %} + {% include 'post/post_controls.html' %} <div class="body" {% if post.files|length > 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 %} <a href="{{ post.root }}{{ board.dir }}{{ config.dir.res }}{{ config.file_page50|sprintf(post.id) }}">[{% trans %}Last 1 Post{% plural lastcount %}Last {{ count }} Posts{% endtrans %}]</a> {% endif %} - {{ post.postControls }} + {% include 'post/post_controls.html' %} </p> <div class="body"> {% endfilter %}{% if index %}{{ post.body|truncate_body(post.link) }}{% else %}{{ post.body }}{% endif %}{% filter remove_whitespace %} |
