Introduce Item.show_quota_left

This commit is contained in:
Raphael Michel
2019-07-10 16:08:21 +02:00
parent 6d6cd3b7cf
commit 491753008d
10 changed files with 63 additions and 7 deletions

View File

@@ -356,6 +356,16 @@ class ItemCreateForm(I18nModelForm):
]
class ShowQuotaNullBooleanSelect(forms.NullBooleanSelect):
def __init__(self, attrs=None):
choices = (
('1', _('(Event default)')),
('2', _('Yes')),
('3', _('No')),
)
super(forms.NullBooleanSelect, self).__init__(attrs, choices)
class TicketNullBooleanSelect(forms.NullBooleanSelect):
def __init__(self, attrs=None):
choices = (
@@ -415,6 +425,7 @@ class ItemUpdateForm(I18nModelForm):
'generate_tickets',
'original_price',
'require_bundling',
'show_quota_left'
]
field_classes = {
'available_from': SplitDateTimeField,
@@ -423,7 +434,8 @@ class ItemUpdateForm(I18nModelForm):
widgets = {
'available_from': SplitDateTimePickerWidget(),
'available_until': SplitDateTimePickerWidget(attrs={'data-date-after': '#id_available_from_0'}),
'generate_tickets': TicketNullBooleanSelect()
'generate_tickets': TicketNullBooleanSelect(),
'show_quota_left': ShowQuotaNullBooleanSelect()
}

View File

@@ -45,6 +45,7 @@
{% bootstrap_field form.original_price addon_after=request.event.currency layout="control" %}
{% bootstrap_field form.require_approval layout="control" %}
{% bootstrap_field form.generate_tickets layout="control" %}
{% bootstrap_field form.show_quota_left layout="control" %}
{% for f in plugin_forms %}
{% bootstrap_form f layout="control" %}
{% endfor %}