core: allow lock topic

This commit is contained in:
undefined committed 2022-02-12 19:21:35 +08:00
1 parent 931e96a6b4
commit c305e57860
11 files changed
+49 -18

No files matched your search

+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@hydrooj/ui-default",
"version": "4.31.13",
"version": "4.31.14",
"author": "undefined <i@undefined.moe>",
"license": "AGPL-3.0",
"main": "hydro.js",
@@ -34,7 +34,8 @@
reply_edit_text = 'Update',
comment_delete_op = 'delete_reply',
reply_delete_op = 'delete_tail_reply',
reactions = {}
reactions = {},
ddoc = {}
) %}
<ul class="dczcomments__list view--discussion">
{% if handler.user.hasPerm(comment_post_perm) %}
@@ -44,6 +45,9 @@
<img src="{{ avatarUrl(handler.user.avatar, 60) }}" width="60" height="60" class="medium user-profile-avatar">
</div>
<div class="media__body top">
{% if ddoc.lock %}
<textarea class="textbox" name="dczcomments__dummy-box" readonly placeholder="{{ _('The discussion is locked, you can not reply anymore.') }}"></textarea>
{% else %}
<div class="hasjs--hide">
<form method="post" class="dczcomments__box" name="dczcomments__box__form" data-hotkey="ctrl+enter:submit,esc:vjCommentBoxCancel">
<div>
@@ -73,6 +77,7 @@
</div>
</li>
</ul>
{% endif %}
</div>
</div>
</li>
@@ -45,6 +45,16 @@
<span class="starred--show"><span class="icon icon-star"></span> {{ _('Unstar Topic') }}</span>
</button>
</form></li>
{% endif %}
{% if handler.user.own(ddoc) or handler.user.hasPerm(perm.PERM_LOCK_DISCUSSION) %}
<li><form class="form--inline" method="post">
<input type="hidden" name="operation" value="set_lock">
{% if not ddoc.lock %}<input type="hidden" name="lock" value="1">{% endif %}
<button class="star{% if ddoc.lock %} activated{% endif %}" type="submit">
<span class="starred--hide">{{ _('Lock Topic') }}</span>
<span class="starred--show">{{ _('Unlock Topic') }}</span>
</button>
</form></li>
{% endif %}
<li><a href="{{ url('wiki_help', anchor='contact') }}">
<span class="icon icon-warning"></span> {{ _('Report') }}
@@ -78,7 +88,8 @@
reply_delete_perm = perm.PERM_DELETE_DISCUSSION_REPLY_SELF_DISCUSSION if handler.user.own(ddoc) else perm.PERM_DELETE_DISCUSSION_REPLY,
reply_edit_self_perm = perm.PERM_EDIT_DISCUSSION_REPLY_SELF,
reply_delete_self_perm = perm.PERM_DELETE_DISCUSSION_REPLY_SELF,
reactions = reactions
reactions = reactions,
ddoc = ddoc
) }}
{{ paginator.render(page, pcount) }}
{% if drcount == 0 %}
@@ -97,9 +108,7 @@
<img src="{{ avatarUrl(udoc.avatar, 80) }}" width="80" height="80" class="medium user-profile-avatar">
</div>
<div class="media__body">
<p>
{{ user.render_inline(udoc, avatar=false, modbadge=false) }}
</p>
<p>{{ user.render_inline(udoc, avatar=false, modbadge=false) }}</p>
</div>
</div>
</div>