From 962cdef69a93d1265f43f92b2d6d640b7b9c1c67 Mon Sep 17 00:00:00 2001 From: Bolutife Lawrence Date: Mon, 8 May 2017 16:46:35 +0100 Subject: [PATCH] Fix #379 -- Add logo to event organizers (#431) * [WIP] Add logo to event organizers. * Fix indentation issues. * Refactor code Refactor code Refactor code * Add new migration * Take files into account for organizer sform (settings form) * Fix grammer * Make bootstrap form errors specific to each fieldset * Display logo on organizer's page * Fix PR issues Fix PR issues Fix PR issues * Reorder imports * Remove conflicting migration * Fix rebase conflict --- src/pretix/control/forms/organizer.py | 14 +++++- .../control/templates/pretixcontrol/base.html | 2 +- .../pretixcontrol/organizers/edit.html | 9 +++- src/pretix/control/views/organizer.py | 49 ++++++++++++++++++- src/pretix/presale/context.py | 4 ++ .../templates/pretixpresale/event/base.html | 10 ++-- .../pretixpresale/organizers/base.html | 13 +++-- .../static/pretixpresale/scss/main.scss | 2 +- 8 files changed, 89 insertions(+), 14 deletions(-) diff --git a/src/pretix/control/forms/organizer.py b/src/pretix/control/forms/organizer.py index 867739c2a..c80c57f4b 100644 --- a/src/pretix/control/forms/organizer.py +++ b/src/pretix/control/forms/organizer.py @@ -2,8 +2,9 @@ from django import forms from django.core.exceptions import ValidationError from django.utils.translation import ugettext_lazy as _ -from pretix.base.forms import I18nModelForm +from pretix.base.forms import I18nModelForm, SettingsForm from pretix.base.models import Organizer, Team +from pretix.control.forms import ExtFileField from pretix.multidomain.models import KnownDomain @@ -98,3 +99,14 @@ class TeamForm(forms.ModelForm): 'the permission to change teams and permissions.')) return data + + +class OrganizerSettingsForm(SettingsForm): + + organizer_logo_image = ExtFileField( + label=_('Logo image'), + ext_whitelist=(".png", ".jpg", ".svg", ".gif", ".jpeg"), + required=False, + help_text=_('If you provide a logo image, we will by default not show your organization name ' + 'in the page header. We will show your logo with a maximal height of 120 pixels.') + ) diff --git a/src/pretix/control/templates/pretixcontrol/base.html b/src/pretix/control/templates/pretixcontrol/base.html index fef6124b7..d402d43ab 100644 --- a/src/pretix/control/templates/pretixcontrol/base.html +++ b/src/pretix/control/templates/pretixcontrol/base.html @@ -65,7 +65,7 @@ {{ request.event }}