From a27ced475cfa01605414ad4774fa47e96ef3ff0d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Felix=20Sch=C3=A4fer?= <felix@thegcat.net>
Date: Sun, 23 Jun 2019 01:05:09 +0200
Subject: [PATCH] Make first column less wide

---
 pretix_public_registrations/signals.py              | 13 ++++++++++++-
 .../static/pretix_public_registrations/ui.css       |  4 ++++
 .../templates/pretix_public_registrations/head.html |  6 ++++++
 3 files changed, 22 insertions(+), 1 deletion(-)
 create mode 100644 pretix_public_registrations/static/pretix_public_registrations/ui.css
 create mode 100644 pretix_public_registrations/templates/pretix_public_registrations/head.html

diff --git a/pretix_public_registrations/signals.py b/pretix_public_registrations/signals.py
index fcd6042..582290d 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 0000000..e7119cf
--- /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 0000000..745fcef
--- /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 %}
-- 
GitLab