##// END OF EJS Templates
Ban user without removing a post
neko259 -
r1904:b612804b default
parent child Browse files
Show More
1 NO CONTENT: modified file, binary diff hidden
@@ -596,3 +596,6 b' msgstr "\xd0\x97\xd0\xb0\xd0\xb1\xd0\xb0\xd0\xbd\xd0\xb8\xd1\x82\xd1\x8c \xd0\xb8 \xd1\x83\xd0\xb4\xd0\xb0\xd0\xbb\xd0\xb8\xd1\x82\xd1\x8c"'
596 596 msgid "Are you sure?"
597 597 msgstr "Вы уверены?"
598 598
599 msgid "Ban"
600 msgstr "Забанить"
601
@@ -99,6 +99,15 b''
99 99 },
100 100 visible: {% if post.global_id_id %}true{% else %}false{% endif %}
101 101 },
102 ban: {
103 name: '{% trans "Ban" %}',
104 callback: function(key, opt) {
105 if (confirm('{% trans "Are you sure?" %}')) {
106 window.location = '{% url 'utils' %}?method=ban&post_id={{ post.id }}';
107 }
108 },
109 visible: {% if post.has_ip %}true{% else %}false{% endif %}
110 },
102 111 banAndDelete: {
103 112 name: '{% trans "Ban and delete" %}',
104 113 callback: function(key, opt) {
@@ -24,3 +24,8 b' class UtilsView(BaseBoardView, Dispatche'
24 24 else:
25 25 post.delete()
26 26
27 @permission_required('boards.add_ban')
28 def ban(self, request):
29 post = Post.objects.get(id=request.GET['post_id'])
30 Ban.objects.get_or_create(ip=post.poster_ip)
31
General Comments 0
You need to be logged in to leave comments. Login now