forked from CGM_Public/pretix_original
Item editor: Make dynamic validity more self-explanatory
This commit is contained in:
@@ -631,7 +631,7 @@ class Item(LoggedModel):
|
|||||||
null=True, blank=True, max_length=16,
|
null=True, blank=True, max_length=16,
|
||||||
verbose_name=_('Validity'),
|
verbose_name=_('Validity'),
|
||||||
help_text=_(
|
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 '
|
'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 '
|
'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 '
|
'realize e.g. a booking of a year-long ticket with a dynamic start date. Note that the validity will be '
|
||||||
|
|||||||
@@ -614,6 +614,15 @@ class ItemUpdateForm(I18nModelForm):
|
|||||||
|
|
||||||
self.fields['free_price_suggestion'].widget.attrs['data-display-dependency'] = '#id_free_price'
|
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()
|
qs = self.event.organizer.membership_types.all()
|
||||||
if qs:
|
if qs:
|
||||||
self.fields['require_membership_types'].queryset = qs
|
self.fields['require_membership_types'].queryset = qs
|
||||||
|
|||||||
@@ -209,6 +209,7 @@
|
|||||||
{% bootstrap_field form.validity_fixed_until layout="control" %}
|
{% bootstrap_field form.validity_fixed_until layout="control" %}
|
||||||
</div>
|
</div>
|
||||||
<div data-display-dependency="#{{ form.validity_mode.id_for_label }}" data-display-dependency-value="dynamic">
|
<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">
|
<div class="form-group metadata-group">
|
||||||
<label class="col-md-3 control-label">{% trans "Duration" %}</label>
|
<label class="col-md-3 control-label">{% trans "Duration" %}</label>
|
||||||
<div class="col-md-9">
|
<div class="col-md-9">
|
||||||
@@ -231,8 +232,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{% bootstrap_field form.validity_dynamic_start_choice layout="control" %}
|
<div data-display-dependency="#{{ form.validity_dynamic_start_choice.id_for_label }}" data-display-dependency-value="True">
|
||||||
<div data-display-dependency="#{{ form.validity_dynamic_start_choice.id_for_label }}">
|
|
||||||
{% trans "days" as t_days %}
|
{% trans "days" as t_days %}
|
||||||
{% bootstrap_field form.validity_dynamic_start_choice_day_limit addon_after=t_days layout="control" %}
|
{% bootstrap_field form.validity_dynamic_start_choice_day_limit addon_after=t_days layout="control" %}
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user