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.
This commit is contained in:
typonaut 2020-08-19 18:02:20 +01:00 committed by GitHub
parent 41b9f38ab6
commit 67bd484a35
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -26,7 +26,13 @@
{% blocktrans with item.get_absolute_url as url %}View <a href='{{ url }}'>Answer <i class="fa fa-arrow-right"></i></a>{% endblocktrans %} {% blocktrans with item.get_absolute_url as url %}View <a href='{{ url }}'>Answer <i class="fa fa-arrow-right"></i></a>{% endblocktrans %}
</p> </p>
<div class="well well-sm"> <div class="well well-sm">
<p>{% trans 'Rating' %}: {{ item.score }}</p> <p>{% trans 'Rating' %}:
{% if item.votes > 0 %}
{{ item.score|floatformat }}/10
{% else %}
{% trans 'no score yet' %}
{% endif %}
</p>
<p>{% trans 'Last Update' %}: {{ item.last_updated|naturaltime }}</p> <p>{% trans 'Last Update' %}: {{ item.last_updated|naturaltime }}</p>
</div> </div>
</div> </div>