mirror of
https://github.com/pretix/pretix.git
synced 2026-08-18 12:06:26 +00:00
Compare commits
1
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7d2695e4d3 |
+1
-1
@@ -53,7 +53,7 @@ dependencies = [
|
|||||||
"django-oauth-toolkit==2.3.*",
|
"django-oauth-toolkit==2.3.*",
|
||||||
"django-otp==1.7.*",
|
"django-otp==1.7.*",
|
||||||
"django-phonenumber-field==8.4.*",
|
"django-phonenumber-field==8.4.*",
|
||||||
"django-querytagger==0.0.3",
|
"django-querytagger==0.0.2",
|
||||||
"django-redis==6.0.*",
|
"django-redis==6.0.*",
|
||||||
"django-scopes==2.0.*",
|
"django-scopes==2.0.*",
|
||||||
"django-statici18n==2.7.*",
|
"django-statici18n==2.7.*",
|
||||||
|
|||||||
@@ -1403,12 +1403,15 @@ class Event(EventMixin, LoggedModel):
|
|||||||
|
|
||||||
for mp in self.organizer.meta_properties.all():
|
for mp in self.organizer.meta_properties.all():
|
||||||
if mp.required and not self.meta_data.get(mp.name):
|
if mp.required and not self.meta_data.get(mp.name):
|
||||||
issues.append(format_html(
|
issues.append(
|
||||||
'<a href="{href}{href_hash}">{text}</a>',
|
('<a {a_attr}>' + gettext('You need to fill the meta parameter "{property}".') + '</a>').format(
|
||||||
text=gettext('You need to fill the meta parameter "{property}".').format(property=mp.name),
|
property=mp.name,
|
||||||
href=reverse('control:event.settings', kwargs={'organizer': self.organizer.slug, 'event': self.slug}),
|
a_attr='href="%s#id_prop-%d-value"' % (
|
||||||
href_hash=f'#id_prop-{mp.pk}-value',
|
reverse('control:event.settings', kwargs={'organizer': self.organizer.slug, 'event': self.slug}),
|
||||||
))
|
mp.pk
|
||||||
|
)
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
responses = event_live_issues.send(self)
|
responses = event_live_issues.send(self)
|
||||||
for receiver, response in sorted(responses, key=lambda r: str(r[0])):
|
for receiver, response in sorted(responses, key=lambda r: str(r[0])):
|
||||||
|
|||||||
@@ -535,9 +535,8 @@ EventPluginRegistry = PluginAwareRegistry # for backwards compatibility
|
|||||||
event_live_issues = EventPluginSignal()
|
event_live_issues = EventPluginSignal()
|
||||||
"""
|
"""
|
||||||
This signal is sent out to determine whether an event can be taken live. If you want to
|
This signal is sent out to determine whether an event can be taken live. If you want to
|
||||||
prevent the event from going live, return an error message to display to the user (either
|
prevent the event from going live, return a string that will be displayed to the user
|
||||||
as a SafeString containing HTML, or a string that will be HTML-escaped). If you don't,
|
as the error message. If you don't, your receiver should return ``None``.
|
||||||
your receiver should return ``None``.
|
|
||||||
|
|
||||||
As with all event-plugin signals, the ``sender`` keyword argument will contain the event.
|
As with all event-plugin signals, the ``sender`` keyword argument will contain the event.
|
||||||
"""
|
"""
|
||||||
|
|||||||
@@ -22,7 +22,6 @@
|
|||||||
import importlib
|
import importlib
|
||||||
|
|
||||||
from django import template
|
from django import template
|
||||||
from django.utils.html import conditional_escape
|
|
||||||
from django.utils.safestring import mark_safe
|
from django.utils.safestring import mark_safe
|
||||||
|
|
||||||
from pretix.base.models import Event
|
from pretix.base.models import Event
|
||||||
@@ -45,7 +44,7 @@ def eventsignal(event: Event, signame: str, **kwargs):
|
|||||||
_html = []
|
_html = []
|
||||||
for receiver, response in signal.send(event, **kwargs):
|
for receiver, response in signal.send(event, **kwargs):
|
||||||
if response:
|
if response:
|
||||||
_html.append(conditional_escape(response))
|
_html.append(response)
|
||||||
return mark_safe("".join(_html))
|
return mark_safe("".join(_html))
|
||||||
|
|
||||||
|
|
||||||
@@ -64,5 +63,5 @@ def signal(signame: str, request, **kwargs):
|
|||||||
_html = []
|
_html = []
|
||||||
for receiver, response in signal.send(request, **kwargs):
|
for receiver, response in signal.send(request, **kwargs):
|
||||||
if response:
|
if response:
|
||||||
_html.append(conditional_escape(response))
|
_html.append(response)
|
||||||
return mark_safe("".join(_html))
|
return mark_safe("".join(_html))
|
||||||
|
|||||||
@@ -39,8 +39,7 @@ from pretix.base.signals import (
|
|||||||
html_page_start = GlobalSignal()
|
html_page_start = GlobalSignal()
|
||||||
"""
|
"""
|
||||||
This signal allows you to put code in the beginning of the main page for every
|
This signal allows you to put code in the beginning of the main page for every
|
||||||
page in the backend. You are expected to return a SafeString containing HTML, or
|
page in the backend. You are expected to return HTML.
|
||||||
a string that will be HTML-escaped.
|
|
||||||
|
|
||||||
The ``sender`` keyword argument will contain the request.
|
The ``sender`` keyword argument will contain the request.
|
||||||
"""
|
"""
|
||||||
@@ -130,7 +129,7 @@ event_dashboard_top = EventPluginSignal()
|
|||||||
Arguments: 'request'
|
Arguments: 'request'
|
||||||
|
|
||||||
This signal is sent out to include custom HTML in the top part of the the event dashboard.
|
This signal is sent out to include custom HTML in the top part of the the event dashboard.
|
||||||
Receivers should return a SafeString containing HTML, or a string that will be HTML-escaped.
|
Receivers should return HTML.
|
||||||
|
|
||||||
As with all event plugin signals, the ``sender`` keyword argument will contain the event.
|
As with all event plugin signals, the ``sender`` keyword argument will contain the event.
|
||||||
An additional keyword argument ``subevent`` *can* contain a sub-event.
|
An additional keyword argument ``subevent`` *can* contain a sub-event.
|
||||||
@@ -173,7 +172,6 @@ Arguments: 'form'
|
|||||||
|
|
||||||
This signal allows you to add additional HTML to the form that is used for modifying vouchers.
|
This signal allows you to add additional HTML to the form that is used for modifying vouchers.
|
||||||
You receive the form object in the ``form`` keyword argument.
|
You receive the form object in the ``form`` keyword argument.
|
||||||
Receivers should return a SafeString containing HTML, or a string that will be HTML-escaped.
|
|
||||||
|
|
||||||
As with all event plugin signals, the ``sender`` keyword argument will contain the event.
|
As with all event plugin signals, the ``sender`` keyword argument will contain the event.
|
||||||
"""
|
"""
|
||||||
@@ -211,7 +209,6 @@ Arguments: 'quota'
|
|||||||
|
|
||||||
This signal allows you to append HTML to a Quota's detail view. You receive the
|
This signal allows you to append HTML to a Quota's detail view. You receive the
|
||||||
quota as argument in the ``quota`` keyword argument.
|
quota as argument in the ``quota`` keyword argument.
|
||||||
Receivers should return a SafeString containing HTML, or a string that will be HTML-escaped.
|
|
||||||
|
|
||||||
As with all event plugin signals, the ``sender`` keyword argument will contain the event.
|
As with all event plugin signals, the ``sender`` keyword argument will contain the event.
|
||||||
"""
|
"""
|
||||||
@@ -222,7 +219,6 @@ Arguments: 'subevent'
|
|||||||
|
|
||||||
This signal allows you to append HTML to a SubEvent's detail view. You receive the
|
This signal allows you to append HTML to a SubEvent's detail view. You receive the
|
||||||
subevent as argument in the ``subevent`` keyword argument.
|
subevent as argument in the ``subevent`` keyword argument.
|
||||||
Receivers should return a SafeString containing HTML, or a string that will be HTML-escaped.
|
|
||||||
|
|
||||||
As with all event plugin signals, the ``sender`` keyword argument will contain the event.
|
As with all event plugin signals, the ``sender`` keyword argument will contain the event.
|
||||||
"""
|
"""
|
||||||
@@ -269,8 +265,7 @@ order_info = EventPluginSignal()
|
|||||||
"""
|
"""
|
||||||
Arguments: ``order``, ``request``
|
Arguments: ``order``, ``request``
|
||||||
|
|
||||||
This signal is sent out to display additional information on the order detail page.
|
This signal is sent out to display additional information on the order detail page
|
||||||
Receivers should return a SafeString containing HTML, or a string that will be HTML-escaped.
|
|
||||||
|
|
||||||
As with all event plugin signals, the ``sender`` keyword argument will contain the event.
|
As with all event plugin signals, the ``sender`` keyword argument will contain the event.
|
||||||
Additionally, the argument ``order`` and ``request`` are available.
|
Additionally, the argument ``order`` and ``request`` are available.
|
||||||
@@ -280,8 +275,7 @@ order_approve_info = EventPluginSignal()
|
|||||||
"""
|
"""
|
||||||
Arguments: ``order``, ``request``
|
Arguments: ``order``, ``request``
|
||||||
|
|
||||||
This signal is sent out to display additional information on the order approve page.
|
This signal is sent out to display additional information on the order approve page
|
||||||
Receivers should return a SafeString containing HTML, or a string that will be HTML-escaped.
|
|
||||||
|
|
||||||
As with all event plugin signals, the ``sender`` keyword argument will contain the event.
|
As with all event plugin signals, the ``sender`` keyword argument will contain the event.
|
||||||
Additionally, the argument ``order`` and ``request`` are available.
|
Additionally, the argument ``order`` and ``request`` are available.
|
||||||
@@ -292,7 +286,6 @@ order_position_buttons = EventPluginSignal()
|
|||||||
Arguments: ``order``, ``position``, ``request``
|
Arguments: ``order``, ``position``, ``request``
|
||||||
|
|
||||||
This signal is sent out to display additional buttons for a single position of an order.
|
This signal is sent out to display additional buttons for a single position of an order.
|
||||||
Receivers should return a SafeString containing HTML, or a string that will be HTML-escaped.
|
|
||||||
|
|
||||||
As with all event plugin signals, the ``sender`` keyword argument will contain the event.
|
As with all event plugin signals, the ``sender`` keyword argument will contain the event.
|
||||||
Additionally, the argument ``order`` and ``request`` are available.
|
Additionally, the argument ``order`` and ``request`` are available.
|
||||||
@@ -322,7 +315,6 @@ Arguments: 'request'
|
|||||||
|
|
||||||
This signal is sent out to include template snippets on the settings page of an event
|
This signal is sent out to include template snippets on the settings page of an event
|
||||||
that allows generating a pretix Widget code.
|
that allows generating a pretix Widget code.
|
||||||
Receivers should return a SafeString containing HTML, or a string that will be HTML-escaped.
|
|
||||||
|
|
||||||
As with all event plugin signals, the ``sender`` keyword argument will contain the event.
|
As with all event plugin signals, the ``sender`` keyword argument will contain the event.
|
||||||
A second keyword argument ``request`` will contain the request object.
|
A second keyword argument ``request`` will contain the request object.
|
||||||
|
|||||||
@@ -19,7 +19,7 @@
|
|||||||
</p>
|
</p>
|
||||||
<ul>
|
<ul>
|
||||||
{% for issue in issues %}
|
{% for issue in issues %}
|
||||||
<li>{{ issue }}</li>
|
<li>{{ issue|safe }}</li>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
@@ -42,7 +42,7 @@
|
|||||||
</p>
|
</p>
|
||||||
<ul>
|
<ul>
|
||||||
{% for issue in issues %}
|
{% for issue in issues %}
|
||||||
<li>{{ issue }}</li>
|
<li>{{ issue|safe }}</li>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -161,8 +161,7 @@ voucher_redeem_info = EventPluginSignal()
|
|||||||
"""
|
"""
|
||||||
Arguments: ``voucher``
|
Arguments: ``voucher``
|
||||||
|
|
||||||
This signal is sent out to display additional information on the "redeem a voucher" page.
|
This signal is sent out to display additional information on the "redeem a voucher" page
|
||||||
You are expected to return a SafeString containing HTML, or a string that will be HTML-escaped.
|
|
||||||
|
|
||||||
As with all event plugin signals, the ``sender`` keyword argument will contain the event.
|
As with all event plugin signals, the ``sender`` keyword argument will contain the event.
|
||||||
"""
|
"""
|
||||||
@@ -195,7 +194,6 @@ Arguments: ``request``
|
|||||||
|
|
||||||
This signals allows you to add HTML content to the confirmation page that is presented at the
|
This signals allows you to add HTML content to the confirmation page that is presented at the
|
||||||
end of the checkout process, just before the order is being created.
|
end of the checkout process, just before the order is being created.
|
||||||
You are expected to return a SafeString containing HTML, or a string that will be HTML-escaped.
|
|
||||||
|
|
||||||
As with all event plugin signals, the ``sender`` keyword argument will contain the event. A ``request``
|
As with all event plugin signals, the ``sender`` keyword argument will contain the event. A ``request``
|
||||||
argument will contain the request object.
|
argument will contain the request object.
|
||||||
@@ -278,8 +276,7 @@ order_info = EventPluginSignal()
|
|||||||
"""
|
"""
|
||||||
Arguments: ``order``, ``request``
|
Arguments: ``order``, ``request``
|
||||||
|
|
||||||
This signal is sent out to display additional information on the order detail page.
|
This signal is sent out to display additional information on the order detail page
|
||||||
Return a SafeString containing HTML, or a string that will be HTML-escaped.
|
|
||||||
|
|
||||||
As with all event plugin signals, the ``sender`` keyword argument will contain the event.
|
As with all event plugin signals, the ``sender`` keyword argument will contain the event.
|
||||||
"""
|
"""
|
||||||
@@ -288,8 +285,7 @@ position_info = EventPluginSignal()
|
|||||||
"""
|
"""
|
||||||
Arguments: ``order``, ``position``, ``request``
|
Arguments: ``order``, ``position``, ``request``
|
||||||
|
|
||||||
This signal is sent out to display additional information on the position detail page.
|
This signal is sent out to display additional information on the position detail page
|
||||||
Return a SafeString containing HTML, or a string that will be HTML-escaped.
|
|
||||||
|
|
||||||
As with all event plugin signals, the ``sender`` keyword argument will contain the event.
|
As with all event plugin signals, the ``sender`` keyword argument will contain the event.
|
||||||
"""
|
"""
|
||||||
@@ -298,8 +294,7 @@ order_info_top = EventPluginSignal()
|
|||||||
"""
|
"""
|
||||||
Arguments: ``order``, ``request``
|
Arguments: ``order``, ``request``
|
||||||
|
|
||||||
This signal is sent out to display additional information on top of the order detail page.
|
This signal is sent out to display additional information on top of the order detail page
|
||||||
Return a SafeString containing HTML, or a string that will be HTML-escaped.
|
|
||||||
|
|
||||||
As with all event plugin signals, the ``sender`` keyword argument will contain the event.
|
As with all event plugin signals, the ``sender`` keyword argument will contain the event.
|
||||||
"""
|
"""
|
||||||
@@ -308,8 +303,7 @@ position_info_top = EventPluginSignal()
|
|||||||
"""
|
"""
|
||||||
Arguments: ``order``, ``position``, ``request``
|
Arguments: ``order``, ``position``, ``request``
|
||||||
|
|
||||||
This signal is sent out to display additional information on top of the position detail page.
|
This signal is sent out to display additional information on top of the position detail page
|
||||||
Return a SafeString containing HTML, or a string that will be HTML-escaped.
|
|
||||||
|
|
||||||
As with all event plugin signals, the ``sender`` keyword argument will contain the event.
|
As with all event plugin signals, the ``sender`` keyword argument will contain the event.
|
||||||
"""
|
"""
|
||||||
@@ -355,7 +349,7 @@ This signal is sent out to display additional information on the frontpage above
|
|||||||
of products and but below a custom frontpage text.
|
of products and but below a custom frontpage text.
|
||||||
|
|
||||||
As with all event plugin signals, the ``sender`` keyword argument will contain the event. The
|
As with all event plugin signals, the ``sender`` keyword argument will contain the event. The
|
||||||
receivers are expected to return a SafeString containing HTML, or a string that will be HTML-escaped.
|
receivers are expected to return HTML.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
render_seating_plan = EventPluginSignal()
|
render_seating_plan = EventPluginSignal()
|
||||||
@@ -367,7 +361,7 @@ You will be passed the ``request`` as a keyword argument. If applicable, a ``sub
|
|||||||
``voucher`` argument might be given.
|
``voucher`` argument might be given.
|
||||||
|
|
||||||
As with all event plugin signals, the ``sender`` keyword argument will contain the event. The
|
As with all event plugin signals, the ``sender`` keyword argument will contain the event. The
|
||||||
receivers are expected to return a SafeString containing HTML, or a string that will be HTML-escaped.
|
receivers are expected to return HTML.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
front_page_bottom = EventPluginSignal()
|
front_page_bottom = EventPluginSignal()
|
||||||
@@ -378,7 +372,7 @@ This signal is sent out to display additional information on the frontpage below
|
|||||||
of products.
|
of products.
|
||||||
|
|
||||||
As with all event plugin signals, the ``sender`` keyword argument will contain the event. The
|
As with all event plugin signals, the ``sender`` keyword argument will contain the event. The
|
||||||
receivers are expected to return a SafeString containing HTML, or a string that will be HTML-escaped.
|
receivers are expected to return HTML.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
front_page_bottom_widget = EventPluginSignal()
|
front_page_bottom_widget = EventPluginSignal()
|
||||||
@@ -389,7 +383,7 @@ This signal is sent out to display additional information on the frontpage below
|
|||||||
of products if the front page is shown in the widget.
|
of products if the front page is shown in the widget.
|
||||||
|
|
||||||
As with all event plugin signals, the ``sender`` keyword argument will contain the event. The
|
As with all event plugin signals, the ``sender`` keyword argument will contain the event. The
|
||||||
receivers are expected to return a SafeString containing HTML, or a string that will be HTML-escaped.
|
receivers are expected to return HTML.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
checkout_all_optional = EventPluginSignal()
|
checkout_all_optional = EventPluginSignal()
|
||||||
@@ -409,7 +403,7 @@ Arguments: ``item``, ``variation``, ``subevent``
|
|||||||
|
|
||||||
This signal is sent out when the description of an item or variation is rendered and allows you to append
|
This signal is sent out when the description of an item or variation is rendered and allows you to append
|
||||||
additional text to the description. You are passed the ``item``, ``variation`` and ``subevent``. You are
|
additional text to the description. You are passed the ``item``, ``variation`` and ``subevent``. You are
|
||||||
expected to return markdown.
|
expected to return HTML.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
register_cookie_providers = EventPluginSignal()
|
register_cookie_providers = EventPluginSignal()
|
||||||
|
|||||||
@@ -9,7 +9,7 @@
|
|||||||
{% load anonymize_email %}
|
{% load anonymize_email %}
|
||||||
{% block thetitle %}
|
{% block thetitle %}
|
||||||
{% if messages %}
|
{% if messages %}
|
||||||
{{ messages|join:" " }} ::
|
{{ messages|join:" " }} ::
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% block title %}{% endblock %}{% if request.resolver_match.url_name != "event.index" %} :: {% endif %}{{ event.name }}
|
{% block title %}{% endblock %}{% if request.resolver_match.url_name != "event.index" %} :: {% endif %}{{ event.name }}
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
{% extends "pretixpresale/event/base.html" %}
|
{% extends "pretixpresale/event/base.html" %}
|
||||||
{% load i18n %}
|
{% load i18n %}
|
||||||
{% load l10n %}
|
{% load l10n %}
|
||||||
{% load static %}
|
|
||||||
{% load eventurl %}
|
{% load eventurl %}
|
||||||
{% load cache_large %}
|
{% load cache_large %}
|
||||||
{% load money %}
|
{% load money %}
|
||||||
@@ -40,7 +39,6 @@
|
|||||||
{% else %}
|
{% else %}
|
||||||
<meta property="og:url" content="{% abseventurl request.event "presale:event.index" %}" />
|
<meta property="og:url" content="{% abseventurl request.event "presale:event.index" %}" />
|
||||||
{% endif %}
|
{% endif %}
|
||||||
<script type="text/javascript" src="{% static "pretixpresale/js/csrfcookieretry.js" %}"></script>
|
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
{% block content %}
|
{% block content %}
|
||||||
|
|
||||||
|
|||||||
@@ -6,7 +6,6 @@
|
|||||||
{% load money %}
|
{% load money %}
|
||||||
{% load expiresformat %}
|
{% load expiresformat %}
|
||||||
{% load eventurl %}
|
{% load eventurl %}
|
||||||
{% load static %}
|
|
||||||
{% load phone_format %}
|
{% load phone_format %}
|
||||||
{% load rich_text %}
|
{% load rich_text %}
|
||||||
{% load getitem %}
|
{% load getitem %}
|
||||||
@@ -23,10 +22,6 @@
|
|||||||
{% endif %}
|
{% endif %}
|
||||||
{% trans "Order details" %}
|
{% trans "Order details" %}
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
{% block custom_header %}
|
|
||||||
{{ block.super }}
|
|
||||||
<script type="text/javascript" src="{% static "pretixpresale/js/csrfcookieretry.js" %}"></script>
|
|
||||||
{% endblock %}
|
|
||||||
{% block content %}
|
{% block content %}
|
||||||
{% if "thanks" in request.GET or "paid" in request.GET %}
|
{% if "thanks" in request.GET or "paid" in request.GET %}
|
||||||
<div class="thank-you">
|
<div class="thank-you">
|
||||||
|
|||||||
@@ -1,15 +0,0 @@
|
|||||||
document.addEventListener("DOMContentLoaded", () => {
|
|
||||||
const COOKIE_NAME = "__Host-pretix_csrftoken";
|
|
||||||
const RELOAD_FLAG = "csrfReloadPerformed";
|
|
||||||
|
|
||||||
const hasCookie = document.cookie
|
|
||||||
.split("; ")
|
|
||||||
.some((c) => c.startsWith(COOKIE_NAME + "="));
|
|
||||||
|
|
||||||
if (!hasCookie && !sessionStorage.getItem(RELOAD_FLAG)) {
|
|
||||||
sessionStorage.setItem(RELOAD_FLAG, "1");
|
|
||||||
location.reload();
|
|
||||||
} else if (hasCookie && sessionStorage.getItem(RELOAD_FLAG)) {
|
|
||||||
sessionStorage.removeItem(RELOAD_FLAG);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
Reference in New Issue
Block a user