Restructure our python module. A lot.

This commit is contained in:
Raphael Michel
2015-02-14 17:55:13 +01:00
parent cf18f3e200
commit 077413f41c
117 changed files with 193 additions and 163 deletions

View File

@@ -0,0 +1,28 @@
{% extends "pretixcontrol/event/base.html" %}
{% load i18n %}
{% block title %}{{ item.name }} :: {% trans "Item" %}{% endblock %}
{% block content %}
{% if item.identity %}
<h1>{% trans "Modify item:" %} {{ item.name }}</h1>
<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=item.identity %}">{% 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=item.identity %}">{% trans "Variations" %}</a></li>
<li {% if "event.item.restrictions" == url_name %}class="active"{% endif %}><a href="{% url 'control:event.item.restrictions' organizer=request.event.organizer.slug event=request.event.slug item=item.identity %}">{% trans "Restrictions" %}</a></li>
</ul>
{% else %}
<h1>{% trans "Create item" %}</h1>
<p>{% blocktrans trimmed %}
You will be able to adjust further settings in the next step.
{% endblocktrans %}</p>
{% endif %}
{% if item.identity and not item.quotas.exists %}
<div class="alert alert-warning">
{% blocktrans trimmed %}
Please note, that your item will <strong>not</strong> be available for sale until you added your item
to an existing or newly created quota.
{% endblocktrans %}
</div>
{% endif %}
{% block inside %}
{% endblock %}
{% endblock %}

View File

@@ -0,0 +1,36 @@
{% extends "pretixcontrol/item/base.html" %}
{% load i18n %}
{% load bootstrap3 %}
{% block inside %}
{% if "success" in request.GET %}
<div class="alert alert-success">
{% trans "Your changes have been saved." %}
</div>
{% endif %}
<form action="" method="post" class="form-horizontal">
{% csrf_token %}
<fieldset>
<legend>{% trans "General information" %}</legend>
{% bootstrap_field form.name layout="horizontal" %}
{% bootstrap_field form.active layout="horizontal" %}
{% bootstrap_field form.category layout="horizontal" %}
{% bootstrap_field form.short_description layout="horizontal" %}
{% bootstrap_field form.long_description layout="horizontal" %}
</fieldset>
<fieldset>
<legend>{% trans "Price settings" %}</legend>
{% bootstrap_field form.default_price layout="horizontal" %}
{% bootstrap_field form.tax_rate layout="horizontal" %}
</fieldset>
<fieldset>
<legend>{% trans "Advanced settings" %}</legend>
{% bootstrap_field form.properties layout="horizontal" %}
{% bootstrap_field form.questions layout="horizontal" %}
</fieldset>
<div class="form-group submit-group">
<button type="submit" class="btn btn-primary btn-save">
{% trans "Save" %}
</button>
</div>
</form>
{% endblock %}

View File

@@ -0,0 +1,71 @@
{% extends "pretixcontrol/item/base.html" %}
{% load i18n %}
{% load bootstrap3 %}
{% load formset_tags %}
{% block inside %}
<p>{% blocktrans trimmed %}
In this area, you can choose of a set of "restriction types" to restrict the availability of your item with
certain conditions.
{% endblocktrans %}</p>
<form action="" method="post">
{% csrf_token %}
{% for set in formsets %}
<fieldset>
<legend>{{ set.title }}</legend>
<p>{{ set.description }}</p>
<div data-formset class="restriction-formset" data-formset-prefix="{{ set.formset.prefix }}">
<div data-formset-body class="panel-group collapse" id="accordion_{{ set.formset.prefix }}">
{{ set.formset.management_form }}
{% for f in set.formset %}
<div class="panel panel-default" data-formset-form>
<div class="panel-heading">
<h4 class="panel-title">
<a data-toggle="collapse" data-parent="#accordion"
href="#collapse{{ f.prefix }}">
{{ set.title }}
</a>
</h4>
</div>
<div id="collapse{{ f.prefix }}" class="panel-collapse collapse in">
<div class="panel-body">
<div class="form-horizontal">
{% bootstrap_form f layout="horizontal" field_class="col-md-10" %}
</div>
</div>
</div>
</div>
{% endfor %}
</div>
<script type="form-template" data-formset-empty-form>
{% escapescript %}
<div class="panel panel-default" data-formset-form>
<div class="panel-heading">
<h4 class="panel-title">
<a data-toggle="collapse" data-parent="#accordion" href="#collapse__prefix__">
{% trans "New restriction" %}
</a>
</h4>
</div>
<div id="collapse__prefix__" class="panel-collapse collapse in">
<div class="panel-body">
<div class="form-horizontal">
{% bootstrap_form set.formset.initialized_empty_form layout="horizontal" field_class="col-md-10" %}
</div>
</div>
</div>
</div>
{% endescapescript %}
</script>
<button type="button" class="btn btn-default" data-formset-add><i
class="fa fa-plus"></i> {% trans "Add a new restriction" %}</button>
</div>
</fieldset>
{% endfor %}
<div class="form-group submit-group">
<button type="submit" class="btn btn-primary btn-save">
{% trans "Save" %}
</button>
</div>
</form>
{% endblock %}

View File

@@ -0,0 +1,6 @@
{% extends "pretixcontrol/item/base.html" %}
{% load i18n %}
{% load bootstrap3 %}
{% block inside %}
<em>{% trans "You have to define and select propreties to be able to configure variations." %}
{% endblock %}

View File

@@ -0,0 +1,33 @@
{% extends "pretixcontrol/item/base.html" %}
{% load i18n %}
{% load bootstrap3 %}
{% block inside %}
<form action="" method="post">
{% csrf_token %}
<table class="table">
<thead>
<tr>
<th>{{ properties.0 }}</th>
<th>{% trans "Active" %}</th>
<th>{% trans "Price" %}</th>
</tr>
</thead>
<tbody>
{% for form in forms %}
{% bootstrap_form_errors form type='all' layout='inline' %}
<tr>
<td>{{ form.values.0 }}</td>
<td>{% bootstrap_field form.active layout='inline' %}</td>
<td>{% bootstrap_field form.default_price layout='inline' %} {{ form.default_price.errors }}</td>
</tr>
{% endfor %}
</tbody>
</table>
<div class="form-group submit-group">
<button type="submit" class="btn btn-primary btn-save">
{% trans "Save" %}
</button>
</div>
</form>
{% endblock %}

View File

@@ -0,0 +1,49 @@
{% extends "pretixcontrol/item/base.html" %}
{% load i18n %}
{% load bootstrap3 %}
{% block inside %}
<form action="" method="post">
{% csrf_token %}
{% for major in forms %}
{% if major.row %}
<h3>{{ major.row }}</h3>
{% endif %}
<table class="table variation-matrix">
<thead>
<tr>
<th></th>
{% for val in properties.1.values.all %}
<th>{{ val.value }}</th>
{% endfor %}
</tr>
</thead>
<tbody>
{% for sub in major.forms %}
<tr>
<td>{{ sub.row.value }}</td>
{% for form in sub.forms %}
<td>
<div class="row">
<div class="col-sm-5">
{% bootstrap_field form.active layout='inline' %}
</div>
<div class="col-sm-7">
{% bootstrap_field form.default_price layout='inline' %}
</div>
</div>
{{ form.default_price.errors }}
</td>
{% endfor %}
</tr>
{% endfor %}
</tbody>
</table>
{% endfor %}
<div class="form-group submit-group">
<button type="submit" class="btn btn-primary btn-save">
{% trans "Save" %}
</button>
</div>
</form>
{% endblock %}