From 8f3d85a8afa851f4457163d3aade01c1f63075a0 Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Sat, 25 Jun 2022 01:14:09 +0300 Subject: Fix recommendations counters in html templates * deprecate `likes` message field, use `recommendations` where possible --- src/main/resources/templates/views/partial/message.html | 8 ++++---- src/main/resources/templates/views/thread.html | 10 +++++----- 2 files changed, 9 insertions(+), 9 deletions(-) (limited to 'src/main/resources/templates') diff --git a/src/main/resources/templates/views/partial/message.html b/src/main/resources/templates/views/partial/message.html index 47dfb6c5..a41a3064 100644 --- a/src/main/resources/templates/views/partial/message.html +++ b/src/main/resources/templates/views/partial/message.html @@ -37,7 +37,7 @@ - {% if msg.likes > 0 %} {{ msg.likes }} + {% if msg.recommendations.size() > 0 %} {{ msg.recommendations.size() }} {% else %}  {{ i18n("messages","message.recommend") }} {% endif %} @@ -47,7 +47,7 @@ - {% if msg.likes > 0 %} {{ msg.likes }} + {% if msg.recommendations.size() > 0 %} {{ msg.recommendations.size() }} {% else %}  {{ i18n("messages","message.recommend") }} {% endif %} @@ -57,8 +57,8 @@ - {% if msg.likes > 0 %} - {{ msg.likes }} + {% if msg.recommendations.size() > 0 %} + {{ msg.recommendations.size() }} {% else %}  {{ i18n("messages","message.recommend") }} {% endif %} diff --git a/src/main/resources/templates/views/thread.html b/src/main/resources/templates/views/thread.html index f1563a7c..6215aa9a 100644 --- a/src/main/resources/templates/views/thread.html +++ b/src/main/resources/templates/views/thread.html @@ -44,7 +44,7 @@ - {% if msg.Likes > 0 %} {{ msg.Likes }} + {% if msg.recommendations.size() > 0 %} {{ msg.recommendations.size() }} {% else %}  {{ i18n("messages","message.recommend") }} {% endif %} @@ -54,7 +54,7 @@ - {% if msg.Likes > 0 %} {{ msg.Likes }} + {% if msg.recommendations.size() > 0 %} {{ msg.recommendations.size() }} {% else %}  {{ i18n("messages","message.recommend") }} {% endif %} @@ -64,7 +64,7 @@ - {% if msg.Likes > 0 %} {{ msg.Likes }} + {% if msg.recommendations.size() > 0 %} {{ msg.recommendations.size() }} {%else %}  {{ i18n("messages","message.recommend") }} {% endif %} @@ -111,8 +111,8 @@ @{{ rec.name }}{% if loop.index < (loop.length - 1) %}, {% endif %} {% endif %} {% endfor %} - {% if msg.likes > recomm.size() %} -  {{ i18n("messages","message.recommendedOthers", msg.likes - recomm.size()) }} + {% if msg.recommendations.size() > recomm.size() %} +  {{ i18n("messages","message.recommendedOthers", msg.recommendations.size() - recomm.size()) }} {% endif %} {% endif %} -- cgit v1.2.3