From 67bd484a3560b3047d1aa196ca57ba7a3e5c0e75 Mon Sep 17 00:00:00 2001 From: typonaut <55769287+typonaut@users.noreply.github.com> Date: Wed, 19 Aug 2020 18:02:20 +0100 Subject: [PATCH] Update kb_category.html Standardises output between KB listing and KB items rating display (so that both are "n/10", where the listing was previously a float), and captures case where there may be no votes cast. --- helpdesk/templates/helpdesk/kb_category.html | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/helpdesk/templates/helpdesk/kb_category.html b/helpdesk/templates/helpdesk/kb_category.html index d782ae9e..302f084c 100644 --- a/helpdesk/templates/helpdesk/kb_category.html +++ b/helpdesk/templates/helpdesk/kb_category.html @@ -26,7 +26,13 @@ {% blocktrans with item.get_absolute_url as url %}View Answer {% endblocktrans %}
{% trans 'Rating' %}: {{ item.score }}
+{% trans 'Rating' %}: + {% if item.votes > 0 %} + {{ item.score|floatformat }}/10 + {% else %} + {% trans 'no score yet' %} + {% endif %} +
{% trans 'Last Update' %}: {{ item.last_updated|naturaltime }}