diff --git a/pretix_public_registrations/signals.py b/pretix_public_registrations/signals.py index fcd6042043db9da9782e246d27fc964cd3395b74..582290dc9e0c9061c1e53463602e9b197abacdee 100644 --- a/pretix_public_registrations/signals.py +++ b/pretix_public_registrations/signals.py @@ -2,12 +2,23 @@ from django import forms from django.dispatch import receiver from django.template.loader import get_template from django.utils.translation import ugettext_lazy as _, get_language +from django.urls import resolve from django_gravatar.helpers import get_gravatar_url from i18nfield.strings import LazyI18nString -from pretix.presale.signals import question_form_fields, front_page_bottom, process_response +from pretix.presale.signals import question_form_fields, front_page_bottom, process_response, html_head from pretix.base.models import OrderPosition +@receiver(html_head, dispatch_uid="public_registrations_html_head") +def add_public_registrations_html_head(sender, request=None, **kwargs): + url = resolve(request.path_info) + if "event.index" in url.url_name: + template = get_template("pretix_public_registrations/head.html") + return template.render() + else: + return "" + + @receiver(question_form_fields, dispatch_uid="public_registration_question") def add_public_registration_question(sender, **kwargs): return {'public_registration': forms.CharField( diff --git a/pretix_public_registrations/static/pretix_public_registrations/ui.css b/pretix_public_registrations/static/pretix_public_registrations/ui.css new file mode 100644 index 0000000000000000000000000000000000000000..e7119cf0a09517a752dc476354b44511b9662097 --- /dev/null +++ b/pretix_public_registrations/static/pretix_public_registrations/ui.css @@ -0,0 +1,4 @@ +.table > thead > tr > th:first-child, +.table > tbody > tr > td:first-child { + width: 41px; +} diff --git a/pretix_public_registrations/templates/pretix_public_registrations/head.html b/pretix_public_registrations/templates/pretix_public_registrations/head.html new file mode 100644 index 0000000000000000000000000000000000000000..745fcefec2697528b22431b1485ecb025a19f462 --- /dev/null +++ b/pretix_public_registrations/templates/pretix_public_registrations/head.html @@ -0,0 +1,6 @@ +{% load static %} +{% load compress %} + +{% compress css %} + <link type="text/css" rel="stylesheet" href="{% static "pretix_public_registrations/ui.css" %}"> +{% endcompress %}