From 7ae7da5af11bb5036819831231e16f195258abd7 Mon Sep 17 00:00:00 2001 From: Raphael Michel Date: Sat, 7 May 2016 14:29:00 +0200 Subject: [PATCH] Improved list views to look better when they are empty --- .../pretixcontrol/attendees/index.html | 64 +++++++++---- .../pretixcontrol/items/categories.html | 65 +++++++++---- .../templates/pretixcontrol/items/index.html | 69 ++++++++------ .../pretixcontrol/items/questions.html | 62 ++++++++---- .../templates/pretixcontrol/items/quotas.html | 79 ++++++++++----- .../templates/pretixcontrol/orders/index.html | 66 ++++++++----- .../pretixcontrol/vouchers/index.html | 95 +++++++++++-------- src/static/pretixcontrol/scss/main.scss | 9 ++ 8 files changed, 334 insertions(+), 175 deletions(-) diff --git a/src/pretix/control/templates/pretixcontrol/attendees/index.html b/src/pretix/control/templates/pretixcontrol/attendees/index.html index 93c33fe98f..b4854ba880 100644 --- a/src/pretix/control/templates/pretixcontrol/attendees/index.html +++ b/src/pretix/control/templates/pretixcontrol/attendees/index.html @@ -1,9 +1,30 @@ {% extends "pretixcontrol/event/base.html" %} {% load i18n %} +{% load eventurl %} {% block title %}{% trans "Attendees" %}{% endblock %} {% block content %} -

{% trans "Attendees" %}

-

+

{% trans "Attendees" %}

+ {% if attendees|length == 0 %} +
+

+ {% blocktrans trimmed %} + Nobody ordered a ticket yet. + {% endblocktrans %} +

+ + {% if not request.event.live %} + + {% trans "Take your shop live" %} + + {% else %} + + {% trans "Go to the ticket shop" %} + + {% endif %} +
+ {% else %} +

-

-
- - +

+
+
+ @@ -35,21 +56,22 @@ - - + + {% for a in attendees %} - - - - - - - + + + + + + + {% endfor %} - -
{% trans "Order code" %} {% trans "Product" %}{% trans "Order date" %} {% trans "Status" %}
{{ a.order.code }}{{ a.item.name }}{{ a.attendee_name|default:"" }}{{ a.order.datetime|date:"SHORT_DATETIME_FORMAT" }}{% include "pretixcontrol/orders/fragment_order_status.html" with order=a.order %}
{{ a.order.code }}{{ a.item.name }}{{ a.attendee_name|default:"" }}{{ a.order.datetime|date:"SHORT_DATETIME_FORMAT" }}{% include "pretixcontrol/orders/fragment_order_status.html" with order=a.order %}
-
- {% include "pretixcontrol/pagination.html" %} + + + + {% include "pretixcontrol/pagination.html" %} + {% endif %} {% endblock %} diff --git a/src/pretix/control/templates/pretixcontrol/items/categories.html b/src/pretix/control/templates/pretixcontrol/items/categories.html index d195c1306f..bbcdc93e80 100644 --- a/src/pretix/control/templates/pretixcontrol/items/categories.html +++ b/src/pretix/control/templates/pretixcontrol/items/categories.html @@ -2,32 +2,55 @@ {% load i18n %} {% block title %}{% trans "Product categories" %}{% endblock %} {% block inside %} -

{% trans "Product categories" %}

-

- {% trans "Create new category" %} -

-
- - +

{% trans "Product categories" %}

+

+ {% blocktrans trimmed %} + You can use categories to group multiple products together in an organized way. + {% endblocktrans %} +

+ {% if categories|length == 0 %} +
+

+ {% blocktrans trimmed %} + You haven't created any categories yet. + {% endblocktrans %} +

+ + {% trans "Create a new category" %} +
+ {% else %} +

+ {% trans "Create a new category" %} + +

+
+
+ - - + + {% for c in categories %} - - - - - + + + + + {% endfor %} - -
{% trans "Product categories" %}
{{ c.name }} - - -
+ {{ c.name }} + + + + + +
-
- {% include "pretixcontrol/pagination.html" %} + + + + {% include "pretixcontrol/pagination.html" %} + {% endif %} {% endblock %} diff --git a/src/pretix/control/templates/pretixcontrol/items/index.html b/src/pretix/control/templates/pretixcontrol/items/index.html index 8438040b5b..ad82bda197 100644 --- a/src/pretix/control/templates/pretixcontrol/items/index.html +++ b/src/pretix/control/templates/pretixcontrol/items/index.html @@ -2,7 +2,7 @@ {% load i18n %} {% block title %}{% trans "Products" %}{% endblock %} {% block inside %} -

{% trans "Products" %}

+

{% trans "Products" %}

{% blocktrans trimmed %} Below, you find a list of all available products. You can click on a product name to inspect and change @@ -10,42 +10,57 @@ give category. {% endblocktrans %}

-

- {% trans "Create new product" %} -

-
- - + {% if items|length == 0 %} +
+

+ {% blocktrans trimmed %} + You haven't created any products yet. + {% endblocktrans %} +

+ + {% trans "Create a new product" %} +
+ {% else %} +

+ {% trans "Create a new product" %} +

+
+
+ - - + + {% regroup items by category as cat_list %} {% for c in cat_list %} {% for i in c.list %} - - - - - - + {% if not i.active %}{% endif %} + + + + + {% endfor %} {% endfor %} - -
{% trans "Product name" %} {% trans "Category" %}
- {% if not i.active %}{% endif %} - {{ i.name }} - {% if not i.active %}{% endif %} - {% if i.category %}{{ i.category.name }}{% endif %} - - -
{% if i.category %}{{ i.category.name }}{% endif %} + + + + +
-
- {% include "pretixcontrol/pagination.html" %} + + + + {% include "pretixcontrol/pagination.html" %} + {% endif %} {% endblock %} diff --git a/src/pretix/control/templates/pretixcontrol/items/questions.html b/src/pretix/control/templates/pretixcontrol/items/questions.html index 34e0b6dd47..73fef28638 100644 --- a/src/pretix/control/templates/pretixcontrol/items/questions.html +++ b/src/pretix/control/templates/pretixcontrol/items/questions.html @@ -2,31 +2,53 @@ {% load i18n %} {% block title %}{% trans "Questions" %}{% endblock %} {% block inside %} -

{% trans "Questions" %}

-

- {% trans "Create new question" %} -

-
- - +

{% trans "Questions" %}

+

+ {% blocktrans trimmed %} + Questions allow your attendees to fill in additional data about their ticket. If you provide food, one + example might be to ask your users about dietary requirements. + {% endblocktrans %} +

+ {% if questions|length == 0 %} +
+

+ {% blocktrans trimmed %} + You haven't created any questions yet. + {% endblocktrans %} +

+ + {% trans "Create a new question" %} +
+ {% else %} +

+ {% trans "Create a new question" %} + +

+
+
+ - - + + {% for q in questions %} - - - - - + + + + + {% endfor %} - -
{% trans "Question" %} {% trans "Type" %}
{{ q.question }}{{ q.get_type_display }}
{{ q.question }} + {{ q.get_type_display }} +
-
- {% include "pretixcontrol/pagination.html" %} + + + + {% include "pretixcontrol/pagination.html" %} + {% endif %} {% endblock %} diff --git a/src/pretix/control/templates/pretixcontrol/items/quotas.html b/src/pretix/control/templates/pretixcontrol/items/quotas.html index 268c8dce17..f859a94717 100644 --- a/src/pretix/control/templates/pretixcontrol/items/quotas.html +++ b/src/pretix/control/templates/pretixcontrol/items/quotas.html @@ -2,13 +2,35 @@ {% load i18n %} {% block title %}{% trans "Quotas" %}{% endblock %} {% block inside %} -

{% trans "Quotas" %}

-

- {% trans "Create a new quota" %} -

-
- - +

{% trans "Quotas" %}

+

+ {% blocktrans trimmed %} + To make your products actually available, you also need quotas. Quotas define, how many instances of + your product pretix will sell. This way, you can configure whether your event can take an unlimited + number of attendees or the number of attendees is limited. You can assign a product to multiple quotas + to fulfil more complex requirements, e.g. if you want to limit the total number of tickets sold and the + number of a specific ticket type at the same time. + {% endblocktrans %} +

+ {% if quotas|length == 0 %} +
+

+ {% blocktrans trimmed %} + You haven't created any quotas yet. + {% endblocktrans %} +

+ + {% trans "Create a new quota" %} +
+ {% else %} +

+ {% trans "Create a new quota" %} + +

+
+
+ @@ -16,27 +38,32 @@ - - + + {% for q in quotas %} - - - + - - - - + >{{ item.name }} + {% endfor %} + + + + + + {% endfor %} - -
{% trans "Quota name" %} {% trans "Products" %}{% trans "Capacity left" %}
{{ q.name }} - + - {% if q.size == None %}Unlimited{% else %}{{ q.size }}{% endif %}{% include "pretixcontrol/items/fragment_quota_availability.html" with availability=q.availability %}
{% if q.size == None %}Unlimited{% else %}{{ q.size }}{% endif %}{% include "pretixcontrol/items/fragment_quota_availability.html" with availability=q.availability %} + +
-
+ + + + {% endif %} {% include "pretixcontrol/pagination.html" %} {% endblock %} diff --git a/src/pretix/control/templates/pretixcontrol/orders/index.html b/src/pretix/control/templates/pretixcontrol/orders/index.html index 93a1e54b02..cc300d66f8 100644 --- a/src/pretix/control/templates/pretixcontrol/orders/index.html +++ b/src/pretix/control/templates/pretixcontrol/orders/index.html @@ -1,11 +1,32 @@ {% extends "pretixcontrol/event/base.html" %} {% load i18n %} +{% load eventurl %} {% block title %}{% trans "Orders" %}{% endblock %} {% block content %} -

{% trans "Orders" %}

-

+

{% trans "Orders" %}

+ {% if questions|length == 0 %} +
+

+ {% blocktrans trimmed %} + Nobody ordered a ticket yet. + {% endblocktrans %} +

+ + {% if not request.event.live %} + + {% trans "Take your shop live" %} + + {% else %} + + {% trans "Go to the ticket shop" %} + + {% endif %} +
+ {% else %} +

+ action="{% url "control:event.orders.go" event=request.event.slug organizer=request.event.organizer.slug %}">
@@ -34,10 +55,10 @@ -

-
- - +

+
+
+ @@ -45,21 +66,22 @@ - - + + {% for o in orders %} - - - - - - - + + + + + + + {% endfor %} - -
{% trans "Order code" %} {% trans "User" %}{% trans "Order date" %} {% trans "Status" %}
{{ o.code }}{{ o.email }}{{ o.total|floatformat:2 }} {{ request.event.currency }}{{ o.datetime|date:"SHORT_DATETIME_FORMAT" }}{% include "pretixcontrol/orders/fragment_order_status.html" with order=o %}
{{ o.code }}{{ o.email }}{{ o.total|floatformat:2 }} {{ request.event.currency }}{{ o.datetime|date:"SHORT_DATETIME_FORMAT" }}{% include "pretixcontrol/orders/fragment_order_status.html" with order=o %}
-
- {% include "pretixcontrol/pagination.html" %} + + +
+ {% include "pretixcontrol/pagination.html" %} + {% endif %} {% endblock %} diff --git a/src/pretix/control/templates/pretixcontrol/vouchers/index.html b/src/pretix/control/templates/pretixcontrol/vouchers/index.html index 3dc6e2d48f..a93b663407 100644 --- a/src/pretix/control/templates/pretixcontrol/vouchers/index.html +++ b/src/pretix/control/templates/pretixcontrol/vouchers/index.html @@ -4,45 +4,64 @@ {% block inside %}

{% trans "Vouchers" %}

- {% trans "Create a new voucher" %} + {% blocktrans trimmed %} + Vouchers allow you to assign tickets to specific persons for a lower price. They also enable you to + reserve some quota for your very special guests. + {% endblocktrans %}

-
- - - - - - - - - - - - {% for v in vouchers %} + {% if vouchers|length == 0 %} +
+

+ {% blocktrans trimmed %} + You haven't created any vouchers yet. + {% endblocktrans %} +

+ + {% trans "Create a new voucher" %} +
+ {% else %} +

+ {% trans "Create a new voucher" %} +

+
+
{% trans "Voucher code" %}{% trans "Is redeemed" %}{% trans "Expiry" %}{% trans "Product" %}
+ - - - - - + + + + + - {% endfor %} - -
- {{ v.code }} - {% if v.redeemed %}{% trans "Yes" %}{% else %}{% trans "No" %}{% endif %}{{ v.valid_until|date }} - {% if v.item %} - {{ v.item }} - {% else %} - {% blocktrans trimmed with quota=v.quota.name %} - Any product in quota "{{ quota }}" - {% endblocktrans %} - {% endif %} - - - {% trans "Voucher code" %}{% trans "Is redeemed" %}{% trans "Expiry" %}{% trans "Product" %}
-
- {% include "pretixcontrol/pagination.html" %} + + + {% for v in vouchers %} + + + {{ v.code }} + + {% if v.redeemed %}{% trans "Yes" %}{% else %}{% trans "No" %}{% endif %} + {{ v.valid_until|date }} + + {% if v.item %} + {{ v.item }} + {% else %} + {% blocktrans trimmed with quota=v.quota.name %} + Any product in quota "{{ quota }}" + {% endblocktrans %} + {% endif %} + + + + + + {% endfor %} + + + + {% include "pretixcontrol/pagination.html" %} + {% endif %} {% endblock %} diff --git a/src/static/pretixcontrol/scss/main.scss b/src/static/pretixcontrol/scss/main.scss index db75666f55..3ffaa40f26 100644 --- a/src/static/pretixcontrol/scss/main.scss +++ b/src/static/pretixcontrol/scss/main.scss @@ -163,4 +163,13 @@ h1 .btn-sm { } .helper-space-below { margin-bottom: 10px; +} + +.empty-collection { + margin: 20px 0; + text-align: center; + + p { + font-size: 24px; + } } \ No newline at end of file