From d56bd0dd3ee96f0638f23c79fbe03bbe67b62c6f Mon Sep 17 00:00:00 2001 From: =?utf8?q?Stefan=20K=C3=B6gl?= Date: Sun, 14 Feb 2016 17:08:12 +0100 Subject: [PATCH] Fix subscriber counts in podcast toplist/search results --- mygpo/web/templatetags/charts.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/mygpo/web/templatetags/charts.py b/mygpo/web/templatetags/charts.py index 25d17cfc..2a0240c2 100644 --- a/mygpo/web/templatetags/charts.py +++ b/mygpo/web/templatetags/charts.py @@ -1,5 +1,6 @@ from django import template from django.utils.safestring import mark_safe +from django.utils.html import format_html from django.contrib.staticfiles.storage import staticfiles_storage from mygpo.utils import format_time @@ -27,10 +28,15 @@ def vertical_bar(value, max_value, display=None): return '' if ratio > 40: - left, right = ''+ value_str +'', '' + left = format_html('{}', value_str) + right = '' else: - left, right = ' ', ''+ value_str +'' - s = '
%s
%s
' % (ratio, left, right) + left = format_html(' ') + right = format_html('{}', value_str) + + return format_html('
{}
{}
', + ratio, left, right) return s @register.filter -- 2.11.4.GIT