Support custom fonts

This commit is contained in:
Raphael Michel
2017-08-23 13:35:47 +02:00
parent 56338be13e
commit 50ca6ee63d
5 changed files with 96 additions and 38 deletions

View File

@@ -13,6 +13,7 @@ from pretix.base.models import Event, Organizer, TaxRule
from pretix.base.reldate import RelativeDateField, RelativeDateTimeField
from pretix.control.forms import ExtFileField, SlugWidget
from pretix.multidomain.urlreverse import build_absolute_uri
from pretix.presale.style import get_fonts
class EventWizardFoundationForm(forms.Form):
@@ -722,6 +723,13 @@ class DisplaySettingsForm(SettingsForm):
help_text=_('If you provide a logo image, we will by default not show your events name and date '
'in the page header. We will show your logo with a maximal height of 120 pixels.')
)
primary_font = forms.ChoiceField(
label=_('Font'),
choices=[
('Open Sans', 'Open Sans')
],
help_text=_('Only respected by modern browsers.')
)
frontpage_text = I18nFormField(
label=_("Frontpage text"),
required=False,
@@ -732,6 +740,12 @@ class DisplaySettingsForm(SettingsForm):
required=False
)
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
self.fields['primary_font'].choices += [
(a, a) for a in get_fonts()
]
class TicketSettingsForm(SettingsForm):
ticket_download = forms.BooleanField(