mirror of
https://github.com/pretix/pretix.git
synced 2026-05-10 16:04:02 +00:00
Fix #1270 -- Provide preview for fonts in display settings
This commit is contained in:
@@ -200,3 +200,7 @@ class SplitDateTimeField(forms.SplitDateTimeField):
|
|||||||
result = datetime.datetime.combine(*data_list)
|
result = datetime.datetime.combine(*data_list)
|
||||||
return from_current_timezone(result)
|
return from_current_timezone(result)
|
||||||
return None
|
return None
|
||||||
|
|
||||||
|
|
||||||
|
class FontSelect(forms.RadioSelect):
|
||||||
|
option_template_name = 'pretixcontrol/font_option.html'
|
||||||
|
|||||||
@@ -25,8 +25,8 @@ from pretix.base.models.event import EventMetaValue, SubEvent
|
|||||||
from pretix.base.reldate import RelativeDateField, RelativeDateTimeField
|
from pretix.base.reldate import RelativeDateField, RelativeDateTimeField
|
||||||
from pretix.base.settings import PERSON_NAME_SCHEMES
|
from pretix.base.settings import PERSON_NAME_SCHEMES
|
||||||
from pretix.control.forms import (
|
from pretix.control.forms import (
|
||||||
ExtFileField, MultipleLanguagesWidget, SingleLanguageWidget, SlugWidget,
|
ExtFileField, FontSelect, MultipleLanguagesWidget, SingleLanguageWidget,
|
||||||
SplitDateTimeField, SplitDateTimePickerWidget,
|
SlugWidget, SplitDateTimeField, SplitDateTimePickerWidget,
|
||||||
)
|
)
|
||||||
from pretix.multidomain.urlreverse import build_absolute_uri
|
from pretix.multidomain.urlreverse import build_absolute_uri
|
||||||
from pretix.plugins.banktransfer.payment import BankTransfer
|
from pretix.plugins.banktransfer.payment import BankTransfer
|
||||||
@@ -1140,6 +1140,7 @@ class DisplaySettingsForm(SettingsForm):
|
|||||||
choices=[
|
choices=[
|
||||||
('Open Sans', 'Open Sans')
|
('Open Sans', 'Open Sans')
|
||||||
],
|
],
|
||||||
|
widget=FontSelect,
|
||||||
help_text=_('Only respected by modern browsers.')
|
help_text=_('Only respected by modern browsers.')
|
||||||
)
|
)
|
||||||
frontpage_text = I18nFormField(
|
frontpage_text = I18nFormField(
|
||||||
|
|||||||
@@ -12,7 +12,9 @@ from pretix.api.models import WebHook
|
|||||||
from pretix.api.webhooks import get_all_webhook_events
|
from pretix.api.webhooks import get_all_webhook_events
|
||||||
from pretix.base.forms import I18nModelForm, SettingsForm
|
from pretix.base.forms import I18nModelForm, SettingsForm
|
||||||
from pretix.base.models import Device, Organizer, Team
|
from pretix.base.models import Device, Organizer, Team
|
||||||
from pretix.control.forms import ExtFileField, MultipleLanguagesWidget
|
from pretix.control.forms import (
|
||||||
|
ExtFileField, FontSelect, MultipleLanguagesWidget,
|
||||||
|
)
|
||||||
from pretix.multidomain.models import KnownDomain
|
from pretix.multidomain.models import KnownDomain
|
||||||
from pretix.presale.style import get_fonts
|
from pretix.presale.style import get_fonts
|
||||||
|
|
||||||
@@ -260,6 +262,7 @@ class OrganizerDisplaySettingsForm(SettingsForm):
|
|||||||
choices=[
|
choices=[
|
||||||
('Open Sans', 'Open Sans')
|
('Open Sans', 'Open Sans')
|
||||||
],
|
],
|
||||||
|
widget=FontSelect,
|
||||||
help_text=_('Only respected by modern browsers.')
|
help_text=_('Only respected by modern browsers.')
|
||||||
)
|
)
|
||||||
favicon = ExtFileField(
|
favicon = ExtFileField(
|
||||||
|
|||||||
@@ -2,6 +2,10 @@
|
|||||||
{% load i18n %}
|
{% load i18n %}
|
||||||
{% load bootstrap3 %}
|
{% load bootstrap3 %}
|
||||||
{% load hierarkey_form %}
|
{% load hierarkey_form %}
|
||||||
|
{% block custom_header %}
|
||||||
|
{{ block.super }}
|
||||||
|
<link type="text/css" rel="stylesheet" href="{% url "control:pdf.css" %}">
|
||||||
|
{% endblock %}
|
||||||
{% block inside %}
|
{% block inside %}
|
||||||
<h1>{% trans "Display settings" %}</h1>
|
<h1>{% trans "Display settings" %}</h1>
|
||||||
<form action="" method="post" class="form-horizontal" enctype="multipart/form-data">
|
<form action="" method="post" class="form-horizontal" enctype="multipart/form-data">
|
||||||
|
|||||||
@@ -0,0 +1,2 @@
|
|||||||
|
{% load i18n %}{% if widget.wrap_label %}<label{% if widget.attrs.id %} for="{{ widget.attrs.id }}"{% endif %} class="preload-font"
|
||||||
|
data-family="{{ widget.label }}" data-style="regular">{% endif %}{% include "django/forms/widgets/input.html" %}{% if widget.wrap_label %} <strong>{{ widget.label }}</strong><br>{% trans "The quick brown fox jumps over the lazy dog." context "typography" %}</label>{% endif %}
|
||||||
@@ -1,6 +1,10 @@
|
|||||||
{% extends "pretixcontrol/organizers/base.html" %}
|
{% extends "pretixcontrol/organizers/base.html" %}
|
||||||
{% load i18n %}
|
{% load i18n %}
|
||||||
{% load bootstrap3 %}
|
{% load bootstrap3 %}
|
||||||
|
{% block custom_header %}
|
||||||
|
{{ block.super }}
|
||||||
|
<link type="text/css" rel="stylesheet" href="{% url "control:pdf.css" %}">
|
||||||
|
{% endblock %}
|
||||||
{% block inner %}
|
{% block inner %}
|
||||||
<h1>{% trans "Display settings" %}</h1>
|
<h1>{% trans "Display settings" %}</h1>
|
||||||
<form action="" method="post" class="form-horizontal" enctype="multipart/form-data">
|
<form action="" method="post" class="form-horizontal" enctype="multipart/form-data">
|
||||||
|
|||||||
@@ -8,7 +8,7 @@
|
|||||||
{% compress css %}
|
{% compress css %}
|
||||||
<link type="text/css" rel="stylesheet" href="{% static "pretixcontrol/scss/pdfeditor.css" %}">
|
<link type="text/css" rel="stylesheet" href="{% static "pretixcontrol/scss/pdfeditor.css" %}">
|
||||||
{% endcompress %}
|
{% endcompress %}
|
||||||
<link type="text/css" rel="stylesheet" href="{% url "control:pdf.css" organizer=request.organizer.slug event=request.event.slug %}">
|
<link type="text/css" rel="stylesheet" href="{% url "control:pdf.css" %}">
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
{% block content %}
|
{% block content %}
|
||||||
<h1>
|
<h1>
|
||||||
|
|||||||
@@ -34,6 +34,7 @@ urlpatterns = [
|
|||||||
url(r'^users/(?P<id>\d+)/reset$', users.UserResetView.as_view(), name='users.reset'),
|
url(r'^users/(?P<id>\d+)/reset$', users.UserResetView.as_view(), name='users.reset'),
|
||||||
url(r'^users/(?P<id>\d+)/impersonate', users.UserImpersonateView.as_view(), name='users.impersonate'),
|
url(r'^users/(?P<id>\d+)/impersonate', users.UserImpersonateView.as_view(), name='users.impersonate'),
|
||||||
url(r'^users/(?P<id>\d+)/anonymize', users.UserAnonymizeView.as_view(), name='users.anonymize'),
|
url(r'^users/(?P<id>\d+)/anonymize', users.UserAnonymizeView.as_view(), name='users.anonymize'),
|
||||||
|
url(r'^pdf/editor/webfonts.css', pdf.FontsCSSView.as_view(), name='pdf.css'),
|
||||||
url(r'^settings/?$', user.UserSettings.as_view(), name='user.settings'),
|
url(r'^settings/?$', user.UserSettings.as_view(), name='user.settings'),
|
||||||
url(r'^settings/history/$', user.UserHistoryView.as_view(), name='user.settings.history'),
|
url(r'^settings/history/$', user.UserHistoryView.as_view(), name='user.settings.history'),
|
||||||
url(r'^settings/notifications/$', user.UserNotificationsEditView.as_view(), name='user.settings.notifications'),
|
url(r'^settings/notifications/$', user.UserNotificationsEditView.as_view(), name='user.settings.notifications'),
|
||||||
|
|||||||
Reference in New Issue
Block a user