ui: fix "select node to create discussion" hint

This commit is contained in:
undefined committed 2022-02-10 18:08:33 +08:00
1 parent cd157a5e43
commit 1b11e6bcbb
2 files changed
+10 -10

No files matched your search

+1 -1
View File
@@ -1,6 +1,6 @@
{ {
"name": "@hydrooj/ui-default", "name": "@hydrooj/ui-default",
"version": "4.31.11", "version": "4.31.12",
"author": "undefined <i@undefined.moe>", "author": "undefined <i@undefined.moe>",
"license": "AGPL-3.0", "license": "AGPL-3.0",
"main": "hydro.js", "main": "hydro.js",
@@ -15,23 +15,23 @@
{% set tdoc = vnode %} {% set tdoc = vnode %}
{% set owner_udoc = udict[vnode.owner] %} {% set owner_udoc = udict[vnode.owner] %}
{% include "partials/contest_sidebar.html" %} {% include "partials/contest_sidebar.html" %}
{% elif vnode.type == model.document.TYPE_DISCUSSION_NODE %} {% else %}
<div class="section side"> <div class="section side">
{% if vnode.pic %}<div class="discussion-node__bg {{ vnode.pic }}"></div>{% endif %} {% if vnode.pic %}<div class="discussion-node__bg {{ vnode.pic }}"></div>{% endif %}
<div class="section__header"> <div class="section__header">
<h1 class="section__title">{{ vnode['title'] or _('Create Discussion') }}</h1> <h1 class="section__title">{{ vnode['title'] or _('Create Discussion') }}</h1>
</div> </div>
<div class="section__body"> <div class="section__body">
{% if vnode %} {% if vnode._id %}
{% if handler.user.hasPerm(perm.PERM_CREATE_DISCUSSION) %} {% if handler.user.hasPerm(perm.PERM_CREATE_DISCUSSION) %}
<p><a href="{{ url('discussion_create', type=model.discussion.typeDisplay[vnode.type], name=vnode.id) }}" class="expanded primary button">{{ _('Create a Discussion') }}</a></p> <p><a href="{{ url('discussion_create', type=model.discussion.typeDisplay[vnode.type], name=vnode.id) }}" class="expanded primary button">{{ _('Create a Discussion') }}</a></p>
{% else %}
{% if not handler.user.hasPriv(PRIV.PRIV_USER_PROFILE) %}
<p><a href="javascript:showSignInDialog();" class="expanded primary button">{{ _('Login to Create a Discussion') }}</a></p>
{% else %} {% else %}
<p><a href="javascript:;" class="disabled expanded primary button">{{ _('No Permission to Create a Discussion') }}</a></p> {% if not handler.user.hasPriv(PRIV.PRIV_USER_PROFILE) %}
<p><a href="javascript:showSignInDialog();" class="expanded primary button">{{ _('Login to Create a Discussion') }}</a></p>
{% else %}
<p><a href="javascript:;" class="disabled expanded primary button">{{ _('No Permission to Create a Discussion') }}</a></p>
{% endif %}
{% endif %} {% endif %}
{% endif %}
{% else %} {% else %}
<p>{{ _('Select a node to create discussion.') }}</p> <p>{{ _('Select a node to create discussion.') }}</p>
{% endif %} {% endif %}