mirror of
https://github.com/pretix/pretix.git
synced 2026-05-06 15:24:02 +00:00
Item editor: Make dynamic validity more self-explanatory
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user