UPD: improved the event export list feature.

This commit is contained in:
2018-12-13 19:00:30 +01:00
parent 85b6e018de
commit 4495322574
2 changed files with 39 additions and 21 deletions

View File

@@ -20,11 +20,14 @@ logger = logging.getLogger(__name__)
class EventListExportForm(forms.Form):
sport = forms.ChoiceField(choices=choices.SPORT_CHOICES,
required=False,
label=_(u'Spielart'),
)
sport = forms.MultipleChoiceField(choices=choices.SPORT_CHOICES,
required=False,
label=_(u'Spielart'),
initial=[c for c, l in choices.SPORT_CHOICES],
widget=forms.CheckboxSelectMultiple(),
)
begin = forms.DateField(required=False,
initial=datetime.date.today(),
label=_(u'Zeitraum - Start'),
help_text=u'%s - %s' % (
_(u'Format: tt.mm.jjjj'),
@@ -58,16 +61,25 @@ class EventListExportForm(forms.Form):
'pickerPosition': 'bottom-left',
},
bootstrap_version=3))
expired = forms.BooleanField(required=False,
label=_(u'auch ausgelaufene Veranstaltungen auflisten'))
def __init__(self, *args, **kwargs):
super(EventListExportForm, self).__init__(*args, **kwargs)
sport_choices = self.fields['sport'].widget.choices
sport_choices.append((None, u'Alle'))
sport_choices.sort()
self.fields['sport'].widget.choices = sport_choices
deadline = forms.DateField(required=False,
initial=datetime.date.today(),
label=_(u'Frühester Anmeldeschluss'),
help_text=u'%s - %s - %s' % (
_(u'Veranstaltungen ausschließen,'
u' deren Anmeldeschluss an dem gewählten Datum bereits abgelaufen ist'),
_(u'Kann frei gelassen werden'),
_(u'Format: tt.mm.jjjj'),
),
widget=DateWidget(attrs={'id': 'id_deadline_widget',
'placeholder': _(u'Anmeldeschluss ignorieren'),
},
usel10n=True,
options={
# 'format': 'dd.mm.yyyy',
# 'weekStart': 1,
'pickerPosition': 'bottom-left',
},
bootstrap_version=3))
class EventUpdateForm(forms.ModelForm):
class Meta: