diff --git a/src/pretix/control/templates/pretixcontrol/dashboard.html b/src/pretix/control/templates/pretixcontrol/dashboard.html index 7dace39370..cfc2a90460 100644 --- a/src/pretix/control/templates/pretixcontrol/dashboard.html +++ b/src/pretix/control/templates/pretixcontrol/dashboard.html @@ -28,7 +28,7 @@ {% if w.lazy %} {% else %} - {{ w.content|safe }} + {{ w.content }} {% endif %} @@ -51,7 +51,7 @@ {% if w.lazy %} {% else %} - {{ w.content|safe }} + {{ w.content }} {% endif %} @@ -72,7 +72,7 @@ {% if w.lazy %} {% else %} - {{ w.content|safe }} + {{ w.content }} {% endif %} @@ -94,7 +94,7 @@ {% if w.lazy %} {% else %} - {{ w.content|safe }} + {{ w.content }} {% endif %} {% else %} @@ -102,7 +102,7 @@ {% if w.lazy %} {% else %} - {{ w.content|safe }} + {{ w.content }} {% endif %} {% endif %} diff --git a/src/pretix/control/templates/pretixcontrol/event/index.html b/src/pretix/control/templates/pretixcontrol/event/index.html index f1fd140be9..a8d04040de 100644 --- a/src/pretix/control/templates/pretixcontrol/event/index.html +++ b/src/pretix/control/templates/pretixcontrol/event/index.html @@ -106,7 +106,7 @@ {% if w.lazy %} {% else %} - {{ w.content|safe }} + {{ w.content }} {% endif %} {% elif w.link %} @@ -114,7 +114,7 @@ {% if w.lazy %} {% else %} - {{ w.content|safe }} + {{ w.content }} {% endif %} {% else %} @@ -122,7 +122,7 @@ {% if w.lazy %} {% else %} - {{ w.content|safe }} + {{ w.content }} {% endif %} {% endif %} diff --git a/src/pretix/control/views/dashboards.py b/src/pretix/control/views/dashboards.py index 02bddc9964..33f5d8489a 100644 --- a/src/pretix/control/views/dashboards.py +++ b/src/pretix/control/views/dashboards.py @@ -49,7 +49,7 @@ from django.shortcuts import render from django.template.loader import get_template from django.urls import reverse from django.utils.formats import date_format -from django.utils.html import escape +from django.utils.html import escape, format_html from django.utils.timezone import now from django.utils.translation import gettext_lazy as _, ngettext, pgettext @@ -112,7 +112,7 @@ def base_widgets(sender, subevent=None, lazy=False, **kwargs): return [ { - 'content': None if lazy else NUM_WIDGET.format(num=intcomma(tickc), text=_('Attendees (ordered)')), + 'content': None if lazy else format_html(NUM_WIDGET, num=intcomma(tickc), text=_('Attendees (ordered)')), 'lazy': 'attendees-ordered', 'display_size': 'small', 'priority': 100, @@ -122,7 +122,7 @@ def base_widgets(sender, subevent=None, lazy=False, **kwargs): }) + ('?subevent={}'.format(subevent.pk) if subevent else '') }, { - 'content': None if lazy else NUM_WIDGET.format(num=intcomma(paidc), text=_('Attendees (paid)')), + 'content': None if lazy else format_html(NUM_WIDGET, num=intcomma(paidc), text=_('Attendees (paid)')), 'lazy': 'attendees-paid', 'display_size': 'small', 'priority': 100, @@ -132,7 +132,7 @@ def base_widgets(sender, subevent=None, lazy=False, **kwargs): }) + ('?subevent={}'.format(subevent.pk) if subevent else '') }, { - 'content': None if lazy else NUM_WIDGET.format( + 'content': None if lazy else format_html(NUM_WIDGET, num=money_filter(round_decimal(rev, sender.currency), sender.currency, hide_currency=True), text=_('Total revenue ({currency})').format(currency=sender.currency) ), @@ -145,7 +145,7 @@ def base_widgets(sender, subevent=None, lazy=False, **kwargs): }) + ('?subevent={}'.format(subevent.pk) if subevent else '') }, { - 'content': None if lazy else NUM_WIDGET.format(num=prodc, text=_('Active products')), + 'content': None if lazy else format_html(NUM_WIDGET, num=prodc, text=_('Active products')), 'lazy': 'active-products', 'display_size': 'small', 'priority': 100, @@ -209,7 +209,7 @@ def waitinglist_widgets(sender, subevent=None, lazy=False, **kwargs): quota_cache[q.pk] = (quota_cache[q.pk][0], quota_cache[q.pk][1] - min(wlt['cnt'], row[1])) widgets.append({ - 'content': None if lazy else NUM_WIDGET.format( + 'content': None if lazy else format_html(NUM_WIDGET, num=intcomma(happy), text=_('available to give to people on waiting list') ), 'lazy': 'waitinglist-avail', @@ -220,7 +220,7 @@ def waitinglist_widgets(sender, subevent=None, lazy=False, **kwargs): }) }) widgets.append({ - 'content': None if lazy else NUM_WIDGET.format(num=intcomma(wles.count()), text=_('total waiting list length')), + 'content': None if lazy else format_html(NUM_WIDGET, num=intcomma(wles.count()), text=_('total waiting list length')), 'lazy': 'waitinglist-length', 'display_size': 'small', 'priority': 50, @@ -247,7 +247,7 @@ def quota_widgets(sender, subevent=None, lazy=False, **kwargs): if not lazy: status, left = qa.results[q] if q in qa.results else q.availability(allow_cache=True) widgets.append({ - 'content': None if lazy else NUM_WIDGET.format( + 'content': None if lazy else format_html(NUM_WIDGET, num='{}/{}'.format(intcomma(left), intcomma(q.size)) if q.size is not None else '\u221e', text=_('{quota} left').format(quota=escape(q.name)) ), @@ -268,7 +268,8 @@ def shop_state_widget(sender, **kwargs): return [{ 'display_size': 'small', 'priority': 1000, - 'content': '