From 1b11e6bcbb84ed4473eee4151f934f492ef86081 Mon Sep 17 00:00:00 2001 From: undefined Date: Thu, 10 Feb 2022 18:08:33 +0800 Subject: [PATCH] ui: fix "select node to create discussion" hint --- packages/ui-default/package.json | 2 +- .../templates/discussion_main_or_node.html | 18 +++++++++--------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/packages/ui-default/package.json b/packages/ui-default/package.json index 8ff743fbc..06d5be3f4 100644 --- a/packages/ui-default/package.json +++ b/packages/ui-default/package.json @@ -1,6 +1,6 @@ { "name": "@hydrooj/ui-default", - "version": "4.31.11", + "version": "4.31.12", "author": "undefined ", "license": "AGPL-3.0", "main": "hydro.js", diff --git a/packages/ui-default/templates/discussion_main_or_node.html b/packages/ui-default/templates/discussion_main_or_node.html index fa89fdb61..3fe291806 100644 --- a/packages/ui-default/templates/discussion_main_or_node.html +++ b/packages/ui-default/templates/discussion_main_or_node.html @@ -15,23 +15,23 @@ {% set tdoc = vnode %} {% set owner_udoc = udict[vnode.owner] %} {% include "partials/contest_sidebar.html" %} - {% elif vnode.type == model.document.TYPE_DISCUSSION_NODE %} + {% else %}
{% if vnode.pic %}
{% endif %}

{{ vnode['title'] or _('Create Discussion') }}

- {% if vnode %} - {% if handler.user.hasPerm(perm.PERM_CREATE_DISCUSSION) %} -

{{ _('Create a Discussion') }}

- {% else %} - {% if not handler.user.hasPriv(PRIV.PRIV_USER_PROFILE) %} -

{{ _('Login to Create a Discussion') }}

+ {% if vnode._id %} + {% if handler.user.hasPerm(perm.PERM_CREATE_DISCUSSION) %} +

{{ _('Create a Discussion') }}

{% else %} -

{{ _('No Permission to Create a Discussion') }}

+ {% if not handler.user.hasPriv(PRIV.PRIV_USER_PROFILE) %} +

{{ _('Login to Create a Discussion') }}

+ {% else %} +

{{ _('No Permission to Create a Discussion') }}

+ {% endif %} {% endif %} - {% endif %} {% else %}

{{ _('Select a node to create discussion.') }}

{% endif %}