forked from CGM_Public/pretix_original
Widget: Add a compatibility mode for Jimdo
This commit is contained in:
@@ -983,6 +983,11 @@ class WidgetCodeForm(forms.Form):
|
||||
"bought via the widget, this voucher will be used. This can for example be used to provide "
|
||||
"widgets that give discounts or unlock secret products.")
|
||||
)
|
||||
compatibility_mode = forms.BooleanField(
|
||||
label=_("Compatibility mode"),
|
||||
help_text=_("Our regular widget doesn't work in all website builders. If you run into trouble, try using "
|
||||
"this compatibility mode.")
|
||||
)
|
||||
|
||||
def __init__(self, *args, **kwargs):
|
||||
self.event = kwargs.pop('event')
|
||||
|
||||
@@ -31,6 +31,20 @@
|
||||
{% else %}
|
||||
{% abseventurl request.event "presale:event.index" as indexurl %}
|
||||
{% endif %}
|
||||
{% if form.cleaned_data.compatibility_mode %}
|
||||
<pre><div class="pretix-widget-compat" event="{% abseventurl request.event "presale:event.index" %}"{% if form.cleaned_data.subevent %} subevent="{{ form.cleaned_data.subevent.pk }}"{% endif %}{% if form.cleaned_data.voucher %} voucher="{{ form.cleaned_data.voucher }}"{% endif %}></div>
|
||||
<noscript>
|
||||
<div class="pretix-widget">
|
||||
<div class="pretix-widget-info-message">
|
||||
{% blocktrans trimmed with a_attr='target="_blank" rel="noopener" href="'|add:indexurl|add:'"'|safe %}
|
||||
JavaScript is disabled in your browser. To access our ticket shop without JavaScript,
|
||||
please <a {{ a_attr }}>click here</a>.
|
||||
{% endblocktrans %}
|
||||
</div>
|
||||
</div>
|
||||
</noscript>
|
||||
</pre>
|
||||
{% else %}
|
||||
<pre><pretix-widget event="{% abseventurl request.event "presale:event.index" %}"{% if form.cleaned_data.subevent %} subevent="{{ form.cleaned_data.subevent.pk }}"{% endif %}{% if form.cleaned_data.voucher %} voucher="{{ form.cleaned_data.voucher }}"{% endif %}></pretix-widget>
|
||||
<noscript>
|
||||
<div class="pretix-widget">
|
||||
@@ -43,6 +57,7 @@
|
||||
</div>
|
||||
</noscript>
|
||||
</pre>
|
||||
{% endif %}
|
||||
<p>
|
||||
<a href="https://docs.pretix.eu/en/latest/user/events/widget.html" target="_blank" rel="noopener">
|
||||
<span class="fa fa-question-circle"></span>
|
||||
|
||||
Reference in New Issue
Block a user