Item editor: Make dynamic validity more self-explanatory

This commit is contained in:
Raphael Michel
2024-01-03 10:51:27 +01:00
parent 301d9de18e
commit d5f2f0e3af
3 changed files with 12 additions and 3 deletions

View File

@@ -631,7 +631,7 @@ class Item(LoggedModel):
null=True, blank=True, max_length=16,
verbose_name=_('Validity'),
help_text=_(
'When setting up a regular event, or an event series with time slots, you typically to NOT need to change '
'When setting up a regular event, or an event series with time slots, you typically do NOT need to change '
'this value. The default setting means that the validity time of tickets will not be decided by the '
'product, but by the event and check-in configuration. Only use the other options if you need them to '
'realize e.g. a booking of a year-long ticket with a dynamic start date. Note that the validity will be '

View File

@@ -614,6 +614,15 @@ class ItemUpdateForm(I18nModelForm):
self.fields['free_price_suggestion'].widget.attrs['data-display-dependency'] = '#id_free_price'
self.fields['validity_dynamic_start_choice'] = forms.TypedChoiceField(
label=_("Start of validity"),
choices=(
("False", _("Purchase date")),
("True", _("Date chosen by customer")),
),
coerce=lambda x: x == 'True',
)
qs = self.event.organizer.membership_types.all()
if qs:
self.fields['require_membership_types'].queryset = qs

View File

@@ -209,6 +209,7 @@
{% bootstrap_field form.validity_fixed_until layout="control" %}
</div>
<div data-display-dependency="#{{ form.validity_mode.id_for_label }}" data-display-dependency-value="dynamic">
{% bootstrap_field form.validity_dynamic_start_choice layout="control" %}
<div class="form-group metadata-group">
<label class="col-md-3 control-label">{% trans "Duration" %}</label>
<div class="col-md-9">
@@ -231,8 +232,7 @@
</div>
</div>
</div>
{% bootstrap_field form.validity_dynamic_start_choice layout="control" %}
<div data-display-dependency="#{{ form.validity_dynamic_start_choice.id_for_label }}">
<div data-display-dependency="#{{ form.validity_dynamic_start_choice.id_for_label }}" data-display-dependency-value="True">
{% trans "days" as t_days %}
{% bootstrap_field form.validity_dynamic_start_choice_day_limit addon_after=t_days layout="control" %}
</div>