From 9178e5e8466fcab9e7b77fdc7b3b8274dc7d11a5 Mon Sep 17 00:00:00 2001 From: undefined Date: Fri, 17 Sep 2021 03:24:01 +0800 Subject: [PATCH] ui: fix homepage training display --- packages/ui-default/package.json | 2 +- .../ui-default/templates/partials/homepage/training.html | 2 +- packages/ui-default/templates/training_detail.html | 5 ++++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/packages/ui-default/package.json b/packages/ui-default/package.json index b87cdf3f8..8130e3936 100644 --- a/packages/ui-default/package.json +++ b/packages/ui-default/package.json @@ -1,6 +1,6 @@ { "name": "@hydrooj/ui-default", - "version": "4.21.3", + "version": "4.21.4", "author": "undefined ", "license": "AGPL-3.0", "main": "hydro.js", diff --git a/packages/ui-default/templates/partials/homepage/training.html b/packages/ui-default/templates/partials/homepage/training.html index c4a05bdb1..033df0cdd 100644 --- a/packages/ui-default/templates/partials/homepage/training.html +++ b/packages/ui-default/templates/partials/homepage/training.html @@ -1,4 +1,4 @@ -{% if trdocs.length %} +{% if tdocs.length %}

{{ _('Training') }}

diff --git a/packages/ui-default/templates/training_detail.html b/packages/ui-default/templates/training_detail.html index c7c0c6ee2..34d230ec7 100644 --- a/packages/ui-default/templates/training_detail.html +++ b/packages/ui-default/templates/training_detail.html @@ -24,7 +24,8 @@
-

{{ _('Section') }} {{ node['_id'] }}. {{ node['title'] }}

+

{{ _('Section') }} {{ node['_id'] }}. {{ node['title'].split('\n')[0] }}

+ {% if node['title'].split('\n')[1] %}

{{ node['title'].split('\n')[1] }}

{% endif %}

@@ -41,6 +42,7 @@

+ {% if tsdoc.enroll %}
  • @@ -151,6 +153,7 @@
+ {% endif %}
{%- endfor -%}