Show download-provider specific icons where defined

This commit is contained in:
Martin Gross
2018-08-15 17:24:49 +02:00
committed by Raphael Michel
parent 08ee37112f
commit 1b5c4a21bb
4 changed files with 11 additions and 3 deletions

View File

@@ -156,3 +156,10 @@ class BaseTicketOutput:
The text on the download button in the frontend.
"""
return _('Download ticket')
@property
def download_button_icon(self) -> str:
"""
The Font Awesome icon on the download button in the frontend.
"""
return 'fa-download'

View File

@@ -63,7 +63,7 @@
<a href="{% eventurl event "presale:event.order.download" secret=order.secret order=order.code output=b.identifier position=line.id %}"
class="btn btn-sm {% if b.identifier == "pdf" %}btn-primary{% else %}btn-default{% endif %}"
data-asyncdownload>
<span class="fa fa-download"></span> {{ b.text }}
<span class="fa {{ b.icon }}"></span> {{ b.text }}
</a>
{% endfor %}
{% endif %}
@@ -150,7 +150,7 @@
<a href="{% eventurl event "presale:event.order.download" secret=order.secret order=order.code output=b.identifier position=line.id %}"
class="btn btn-sm {% if b.identifier == "pdf" %}btn-primary{% else %}btn-default{% endif %}"
data-asyncdownload>
<span class="fa fa-download"></span> {{ b.text }}
<span class="fa {{ b.icon }}"></span> {{ b.text }}
</a>
{% endfor %}
{% endif %}

View File

@@ -99,7 +99,7 @@
<a href="{% eventurl event "presale:event.order.download.combined" secret=order.secret order=order.code output=b.identifier %}"
class="btn btn-sm {% if b.identifier == "pdf" %}btn-primary{% else %}btn-default{% endif %}"
data-asyncdownload>
<span class="fa fa-download"></span> {{ b.text }}
<span class="fa {{ b.icon }}"></span> {{ b.text }}
</a>
{% endif %}
{% endfor %}

View File

@@ -82,6 +82,7 @@ class OrderDetails(EventViewMixin, OrderDetailMixin, CartMixin, TemplateView):
continue
buttons.append({
'text': provider.download_button_text or 'Download',
'icon': provider.download_button_icon or 'fa-download',
'identifier': provider.identifier,
'multi': provider.multi_download_enabled
})