Fix #475 -- add to existing quota / add new quota from product form (#562)

* added fields and logic for adding quota in creation of product

* added section for selecting quota option

* logic for hiding quota selections when needed

* fixed logic for quota selection

* formatting, removed print statements

* styling

* tests for adding quotas in product form

* cleaned up

* added divs

* reworked to include translatable text, readable values for quota options

* quota_add_existing form assignment to str(q.pk)

* made changes for radio buttons, added in sliding animation

* moved string constants for quota options, changed quota options to RadioSelect from Select
This commit is contained in:
Clint
2017-07-26 04:41:23 -07:00
committed by Raphael Michel
parent f3b616e495
commit 4293ec3805
4 changed files with 143 additions and 0 deletions

View File

@@ -2,6 +2,9 @@
{% load i18n %}
{% load bootstrap3 %}
{% block inside %}
{% load static %}
<script type="text/javascript" src="{% static "pretixcontrol/js/ui/hidequota.js" %}"></script>
<form action="" method="post" class="form-horizontal" enctype="multipart/form-data">
{% csrf_token %}
<fieldset>
@@ -12,6 +15,17 @@
{% bootstrap_field form.category layout="horizontal" %}
{% bootstrap_field form.admission layout="horizontal" %}
</fieldset>
<fieldset>
<legend>{% trans "Quota settings" %}</legend>
{% bootstrap_field form.quota_option layout="horizontal" %}
<div id="existing-quota-group">
{% bootstrap_field form.quota_add_existing layout="horizontal" %}
</div>
<div id="new-quota-group">
{% bootstrap_field form.quota_add_new_name layout="horizontal" %}
{% bootstrap_field form.quota_add_new_size layout="horizontal" %}
</div>
</fieldset>
<fieldset>
<legend>{% trans "Price settings" %}</legend>
{% bootstrap_field form.default_price layout="horizontal" %}