Add option to hide "payment pending" bubble on ticket pages

This commit is contained in:
Raphael Michel
2020-12-09 17:02:39 +01:00
parent 663fd8a57a
commit c2345d200a
7 changed files with 19 additions and 2 deletions

View File

@@ -607,6 +607,7 @@ class EventSettingsSerializer(serializers.Serializer):
'payment_term_expire_automatically',
'payment_term_accept_late',
'payment_explanation',
'payment_pending_hidden',
'ticket_download',
'ticket_download_date',
'ticket_download_addons',

View File

@@ -553,6 +553,18 @@ DEFAULTS = {
"the pool and can be ordered by other people."),
)
},
'payment_pending_hidden': {
'default': 'False',
'type': bool,
'form_class': forms.BooleanField,
'serializer_class': serializers.BooleanField,
'form_kwargs': dict(
label=_('Hide "payment pending" state on customer-facing pages'),
help_text=_("The payment instructions panel will still be shown to the primary customer, but no indication "
"of missing payment will be visible on the ticket pages of attendees who did not buy the ticket "
"themselves.")
)
},
'payment_giftcard__enabled': {
'default': 'True',
'type': bool

View File

@@ -559,6 +559,7 @@ class PaymentSettingsForm(SettingsForm):
'payment_term_last',
'payment_term_expire_automatically',
'payment_term_accept_late',
'payment_pending_hidden',
'payment_explanation',
]
tax_rate_default = forms.ModelChoiceField(

View File

@@ -66,6 +66,7 @@
{% bootstrap_field form.payment_term_last layout="control" %}
{% bootstrap_field form.payment_term_expire_automatically layout="control" %}
{% bootstrap_field form.payment_term_accept_late layout="control" %}
{% bootstrap_field form.payment_pending_hidden layout="control" %}
</fieldset>
<fieldset>
<legend>{% trans "Advanced" %}</legend>

View File

@@ -5,6 +5,8 @@
<span class="label label-warning {{ class }}">{% trans "Approval pending" %}</span>
{% elif order.total == 0 %}
<span class="label label-warning {{ class }}">{% trans "Confirmation pending" context "order state" %}</span>
{% elif event.settings.payment_pending_hidden %}
{# intentionally left blank #}
{% else %}
<span class="label label-warning {{ class }}">{% trans "Payment pending" %}</span>
{% endif %}

View File

@@ -53,7 +53,7 @@
{% trans "View in backend" %}
</a>
{% endif %}
{% include "pretixpresale/event/fragment_order_status.html" with order=order class="pull-right flip" %}
{% include "pretixpresale/event/fragment_order_status.html" with order=order event=request.event class="pull-right flip" %}
<div class="clearfix"></div>
</h2>
{% if order.status == "n" and not order.require_approval %}

View File

@@ -18,7 +18,7 @@
{% trans "View in backend" %}
</a>
{% endif %}
{% include "pretixpresale/event/fragment_order_status.html" with order=order class="pull-right flip" %}
{% include "pretixpresale/event/fragment_order_status.html" with order=order event=request.event class="pull-right flip" %}
<div class="clearfix"></div>
</h2>
{% eventsignal event "pretix.presale.signals.position_info_top" order=order position=position request=request %}