Let plugins allow/prevent the download of individual tickets in an order (#3836)

(extends the functionality of the allow_ticket_download signal)
This commit is contained in:
Mira
2024-02-01 17:45:58 +01:00
committed by GitHub
parent 4f4fcb84ce
commit e20edab98f
11 changed files with 140 additions and 125 deletions

View File

@@ -243,7 +243,7 @@
{% if download %}
<div role="cell" class="download-desktop">
{% if line.generate_ticket %}
{% if line in tickets_with_download %}
{% for b in download_buttons %}
<form action="{% if position_page and line.addon_to %}{% eventurl event "presale:event.order.position.download" secret=line.addon_to.web_secret order=order.code output=b.identifier pid=line.pk position=line.addon_to.positionid %}{% elif position_page %}{% eventurl event "presale:event.order.position.download" secret=line.web_secret order=order.code output=b.identifier pid=line.pk position=line.positionid %}{% else %}{% eventurl event "presale:event.order.download" secret=order.secret order=order.code output=b.identifier position=line.pk %}{% endif %}"
method="post" data-asynctask data-asynctask-download class="download-btn-form{% if b.javascript_required %} requirejs{% endif %}">

View File

@@ -35,10 +35,10 @@
</p>
</div>
</div>
{% elif can_download and download_buttons and order.count_positions %}
{% elif can_download and download_buttons and order.count_positions and tickets_with_download %}
<div class="info-download">
<h3 class="sr-only">{% trans "Ticket download" %}</h3>
{% if cart.positions|length > 1 and can_download_multi %} {# never True on ticket page #}
{% if tickets_with_download|length > 1 and can_download_multi %} {# never True on ticket page #}
<div>
{% for b in download_buttons %}
{% if b.multi %}