diff --git a/src/pretix/base/templatetags/textblob.py b/src/pretix/base/templatetags/textblob.py new file mode 100644 index 0000000000..36a59e2dda --- /dev/null +++ b/src/pretix/base/templatetags/textblob.py @@ -0,0 +1,41 @@ +# +# This file is part of pretix (Community Edition). +# +# Copyright (C) 2014-2020 Raphael Michel and contributors +# Copyright (C) 2020-2021 rami.io GmbH and contributors +# +# This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General +# Public License as published by the Free Software Foundation in version 3 of the License. +# +# ADDITIONAL TERMS APPLY: Pursuant to Section 7 of the GNU Affero General Public License, additional terms are +# applicable granting you additional permissions and placing additional restrictions on your usage of this software. +# Please refer to the pretix LICENSE file to obtain the full terms applicable to this work. If you did not receive +# this file, see . +# +# This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied +# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more +# details. +# +# You should have received a copy of the GNU Affero General Public License along with this program. If not, see +# . +# +from django import template +from django.utils.html import format_html, mark_safe + +register = template.Library() + + +@register.simple_tag +def textblob(type, *args, **kwargs): + return format_html( + '{}', + type or "info", + "" if not kwargs["icon"] else format_html( + ' ', + kwargs["icon"] + ) + ) + +@register.simple_tag +def endtextblob(): + return mark_safe('') diff --git a/src/pretix/presale/templates/pretixpresale/event/fragment_order_status.html b/src/pretix/presale/templates/pretixpresale/event/fragment_order_status.html index 615f7df97b..231eabf3b6 100644 --- a/src/pretix/presale/templates/pretixpresale/event/fragment_order_status.html +++ b/src/pretix/presale/templates/pretixpresale/event/fragment_order_status.html @@ -1,46 +1,29 @@ {% load i18n %} {% load bootstrap3 %} +{% load textblob %} {# Changes should be replicated in pretixcontrol/orders/fragment_order_status.html and in pretix/base/models/orders.py #} {% if order.status == "n" %} {% if order.require_approval %} - - {% trans "Approval pending" %} - + {% textblob "warning" icon="exclamation-triangle" %}{% trans "Approval pending" %}{% endtextblob %} {% elif order.total == 0 %} - - {% trans "Confirmation pending" context "order state" %} - + {% textblob "warning" icon="exclamation-triangle" %}{% trans "Confirmation pending" context "order state" %}{% endtextblob %} {% elif event.settings.payment_pending_hidden %} {# intentionally left blank #} {% elif order.valid_if_pending %} - - {% trans "Confirmed" context "order state" %} - + {% textblob "info" icon="info-circle" %}{% trans "Confirmed" context "order state" %}{% endtextblob %} {% else %} - - {% trans "Payment pending" %} - + {% textblob "warning" icon="exclamation-triangle" %}{% trans "Payment pending" %}{% endtextblob %} {% endif %} {% elif order.status == "p" %} {% if order.count_positions == 0 %} - - {% trans "Canceled (paid fee)" %} - + {% textblob "info" icon="info-circle" %}{% trans "Canceled (paid fee)" %}{% endtextblob %} {% elif order.total == 0 %} - - {% trans "Confirmed" context "order state" %} - + {% textblob "success" icon="check" %}{% trans "Confirmed" context "order state" %}{% endtextblob %} {% else %} - - {% trans "Paid" %} - + {% textblob "success" icon="check" %}{% trans "Paid" %}{% endtextblob %} {% endif %} {% elif order.status == "e" %} - - {% trans "Expired" %} - + {% textblob "danger" icon="minus" %}{% trans "Expired" %}{% endtextblob %} {% elif order.status == "c" %} - - {% trans "Canceled" %} - + {% textblob "danger" icon="times" %}{% trans "Canceled" %}{% endtextblob %} {% endif %} diff --git a/src/pretix/static/pretixpresale/scss/main.scss b/src/pretix/static/pretixpresale/scss/main.scss index 0996ad9886..624d997821 100644 --- a/src/pretix/static/pretixpresale/scss/main.scss +++ b/src/pretix/static/pretixpresale/scss/main.scss @@ -537,7 +537,7 @@ h2 .label { font-weight: bold; white-space: nowrap; - &:has(.status-dot) { + &:has(>.fa:first-child) { padding-left: .4em; } } @@ -552,7 +552,7 @@ h2 .label { .text-blob-warning { color: var(--pretix-brand-warning-shade-42); background: var(--pretix-brand-warning-tint-85); - .status-dot { + .fa { color: var(--pretix-brand-warning); } }