mirror of
https://github.com/pretix/pretix.git
synced 2026-03-25 16:12:27 +00:00
Compare commits
1 Commits
master
...
calendar-n
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0fb4fea7bf |
@@ -93,7 +93,7 @@ dependencies = [
|
||||
"redis==7.1.*",
|
||||
"reportlab==4.4.*",
|
||||
"requests==2.32.*",
|
||||
"sentry-sdk==2.56.*",
|
||||
"sentry-sdk==2.54.*",
|
||||
"sepaxml==2.7.*",
|
||||
"stripe==7.9.*",
|
||||
"text-unidecode==1.*",
|
||||
|
||||
@@ -100,7 +100,7 @@ def primary_font_kwargs():
|
||||
|
||||
choices = [('Open Sans', 'Open Sans')]
|
||||
choices += sorted([
|
||||
(a, FontSelect.FontOption(title=a, data=v)) for a, v in get_fonts(pdf_support_required=False).items()
|
||||
(a, {"title": a, "data": v}) for a, v in get_fonts(pdf_support_required=False).items()
|
||||
], key=lambda a: a[0])
|
||||
return {
|
||||
'choices': choices,
|
||||
|
||||
@@ -34,7 +34,6 @@
|
||||
|
||||
import datetime
|
||||
import os
|
||||
from dataclasses import dataclass
|
||||
|
||||
from django import forms
|
||||
from django.conf import settings
|
||||
@@ -421,11 +420,6 @@ class SplitDateTimeField(forms.SplitDateTimeField):
|
||||
class FontSelect(forms.RadioSelect):
|
||||
option_template_name = 'pretixcontrol/font_option.html'
|
||||
|
||||
@dataclass
|
||||
class FontOption:
|
||||
title: str
|
||||
data: str
|
||||
|
||||
|
||||
class ItemMultipleChoiceField(SafeModelMultipleChoiceField):
|
||||
def label_from_instance(self, obj):
|
||||
|
||||
@@ -34,6 +34,7 @@
|
||||
# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
# License for the specific language governing permissions and limitations under the License.
|
||||
|
||||
from dataclasses import dataclass
|
||||
from decimal import Decimal
|
||||
from urllib.parse import urlencode
|
||||
from zoneinfo import ZoneInfo
|
||||
@@ -73,8 +74,8 @@ from pretix.base.settings import (
|
||||
)
|
||||
from pretix.base.validators import multimail_validate
|
||||
from pretix.control.forms import (
|
||||
FontSelect, MultipleLanguagesWidget, SalesChannelCheckboxSelectMultiple,
|
||||
SlugWidget, SplitDateTimeField, SplitDateTimePickerWidget,
|
||||
MultipleLanguagesWidget, SalesChannelCheckboxSelectMultiple, SlugWidget,
|
||||
SplitDateTimeField, SplitDateTimePickerWidget,
|
||||
)
|
||||
from pretix.control.forms.widgets import Select2
|
||||
from pretix.helpers.countries import CachedCountries
|
||||
@@ -578,6 +579,12 @@ class EventSettingsValidationMixin:
|
||||
del self.cleaned_data[field]
|
||||
|
||||
|
||||
@dataclass
|
||||
class FontOption:
|
||||
title: str
|
||||
data: str
|
||||
|
||||
|
||||
class EventSettingsForm(EventSettingsValidationMixin, FormPlaceholderMixin, SettingsForm):
|
||||
timezone = forms.ChoiceField(
|
||||
choices=((a, a) for a in common_timezones),
|
||||
@@ -729,7 +736,7 @@ class EventSettingsForm(EventSettingsValidationMixin, FormPlaceholderMixin, Sett
|
||||
del self.fields['event_list_filters']
|
||||
del self.fields['event_calendar_future_only']
|
||||
self.fields['primary_font'].choices = [('Open Sans', 'Open Sans')] + sorted([
|
||||
(a, FontSelect.FontOption(title=a, data=v)) for a, v in get_fonts(self.event, pdf_support_required=False).items()
|
||||
(a, FontOption(title=a, data=v)) for a, v in get_fonts(self.event, pdf_support_required=False).items()
|
||||
], key=lambda a: a[0])
|
||||
|
||||
# create "virtual" fields for better UX when editing <name>_asked and <name>_required fields
|
||||
|
||||
@@ -37,7 +37,7 @@
|
||||
</select>
|
||||
<span class="input-group-btn">
|
||||
<button type="submit" class="btn btn-default" aria-label="{% trans "Show month" %}">
|
||||
{% icon "chevron-right" %}
|
||||
{% icon "check" %}
|
||||
</button>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
@@ -41,7 +41,7 @@
|
||||
</select>
|
||||
<span class="input-group-btn">
|
||||
<button type="submit" class="btn btn-default" aria-label="{% trans "Show week" %}">
|
||||
{% icon "chevron-right" %}
|
||||
{% icon "check" %}
|
||||
</button>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
@@ -69,7 +69,7 @@
|
||||
</select>
|
||||
<span class="input-group-btn">
|
||||
<button type="submit" class="btn btn-default" aria-label="{% trans "Show month" %}">
|
||||
{% icon "chevron-right" %}
|
||||
{% icon "check" %}
|
||||
</button>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
@@ -61,7 +61,7 @@
|
||||
<input class="datepickerfield form-control" id="calendar-input-date" value="{{ date|date:"SHORT_DATE_FORMAT" }}" name="date">
|
||||
<span class="input-group-btn">
|
||||
<button type="submit" class="btn btn-default" aria-label="{% trans "Show date" %}">
|
||||
{% icon "chevron-right" %}
|
||||
{% icon "check" %}
|
||||
</button>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
@@ -73,7 +73,7 @@
|
||||
</select>
|
||||
<span class="input-group-btn">
|
||||
<button type="submit" class="btn btn-default" aria-label="{% trans "Show week" %}">
|
||||
{% icon "chevron-right" %}
|
||||
{% icon "check" %}
|
||||
</button>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user