Fixed #86 -- Decide about variations at product creation

This commit is contained in:
Raphael Michel
2016-03-10 22:18:53 +01:00
parent 98e135d0c6
commit ad3eb59e6a
5 changed files with 37 additions and 5 deletions

View File

@@ -4,10 +4,20 @@
{% block content %}
{% if object.id %}
<h1>{% trans "Modify product:" %} {{ object.name }}</h1>
{% if object.has_variations %}
<ul class="nav nav-pills">
<li {% if "event.item" == url_name %}class="active"{% endif %}><a href="{% url 'control:event.item' organizer=request.event.organizer.slug event=request.event.slug item=object.id %}">{% trans "General information" %}</a></li>
<li {% if "event.item.variations" == url_name %}class="active"{% endif %}><a href="{% url 'control:event.item.variations' organizer=request.event.organizer.slug event=request.event.slug item=object.id %}">{% trans "Variations" %}</a></li>
<li {% if "event.item" == url_name %}class="active"{% endif %}>
<a href="{% url 'control:event.item' organizer=request.event.organizer.slug event=request.event.slug item=object.id %}">
{% trans "General information" %}
</a>
</li>
<li {% if "event.item.variations" == url_name %}class="active"{% endif %}>
<a href="{% url 'control:event.item.variations' organizer=request.event.organizer.slug event=request.event.slug item=object.id %}">
{% trans "Variations" %}
</a>
</li>
</ul>
{% endif %}
{% else %}
<h1>{% trans "Create product" %}</h1>
<p>{% blocktrans trimmed %}

View File

@@ -8,6 +8,9 @@
<legend>{% trans "General information" %}</legend>
{% bootstrap_field form.name layout="horizontal" %}
{% bootstrap_field form.active layout="horizontal" %}
{% if form.has_variations %}
{% bootstrap_field form.has_variations layout="horizontal" %}
{% endif %}
{% bootstrap_field form.category layout="horizontal" %}
{% bootstrap_field form.admission layout="horizontal" %}
{% bootstrap_field form.description layout="horizontal" %}