From 05daeb561c8a59bcaf4e825fb89f83c5a0838f1c Mon Sep 17 00:00:00 2001 From: Raphael Michel Date: Thu, 10 May 2018 12:04:29 +0200 Subject: [PATCH] Use
und instead of panel-collapse --- .../control/templates/pretixcontrol/base.html | 6 +- .../event/mail_settings_fragment.html | 16 ++-- .../pretixcontrol/event/tax_edit.html | 17 ++--- .../pretixcontrol/order/change_questions.html | 41 +++++------ .../pretixcontrol/orders/export.html | 17 ++--- .../presale/templates/pretixpresale/base.html | 4 +- .../pretixpresale/event/checkout_addons.html | 21 +++--- .../pretixpresale/event/checkout_base.html | 40 +++++----- .../event/checkout_questions.html | 73 +++++++++---------- .../templates/pretixpresale/event/index.html | 40 +++++----- .../pretixpresale/event/order_modify.html | 41 +++++------ .../js/ui => pretixbase/js}/details.js | 4 + src/pretix/static/pretixcontrol/js/ui/main.js | 2 + .../static/pretixcontrol/scss/main.scss | 24 +++++- src/pretix/static/pretixpresale/js/ui/main.js | 2 + .../static/pretixpresale/scss/_event.scss | 13 ---- .../static/pretixpresale/scss/main.scss | 23 +++++- 17 files changed, 198 insertions(+), 186 deletions(-) rename src/pretix/static/{pretixpresale/js/ui => pretixbase/js}/details.js (91%) diff --git a/src/pretix/control/templates/pretixcontrol/base.html b/src/pretix/control/templates/pretixcontrol/base.html index 5885c2a10d..764684016c 100644 --- a/src/pretix/control/templates/pretixcontrol/base.html +++ b/src/pretix/control/templates/pretixcontrol/base.html @@ -42,6 +42,7 @@ + @@ -53,7 +54,10 @@ {% block custom_header %}{% endblock %} - +
+
{% with exclude|split as exclusion %} {% with items|split as item_list %} @@ -51,4 +49,4 @@ {% endwith %}
- +
diff --git a/src/pretix/control/templates/pretixcontrol/event/tax_edit.html b/src/pretix/control/templates/pretixcontrol/event/tax_edit.html index 52b9550f47..b886838e16 100644 --- a/src/pretix/control/templates/pretixcontrol/event/tax_edit.html +++ b/src/pretix/control/templates/pretixcontrol/event/tax_edit.html @@ -21,16 +21,15 @@ {% bootstrap_field form.name layout="control" %} {% bootstrap_field form.rate addon_after="%" layout="control" %} -
-
+
+

- - {% trans "Advanced settings" %} - - + {% trans "Advanced settings" %} +

-
- +
diff --git a/src/pretix/control/templates/pretixcontrol/order/change_questions.html b/src/pretix/control/templates/pretixcontrol/order/change_questions.html index 52956e1da9..bfb67b922d 100644 --- a/src/pretix/control/templates/pretixcontrol/order/change_questions.html +++ b/src/pretix/control/templates/pretixcontrol/order/change_questions.html @@ -19,38 +19,33 @@ {% csrf_token %}
{% if request.event.settings.invoice_address_asked %} -
-
+
+

- - {% trans "Invoice information" %} {% if not request.event.settings.invoice_address_required %} - {% trans "(optional)" %} - {% endif %} - - + {% trans "Invoice information" %} {% if not request.event.settings.invoice_address_required %} + {% trans "(optional)" %} + {% endif %} +

-
- + {% endif %} {% for pos, forms in formgroups %} -
-
+
+

- - {{ pos.item.name }}{% if pos.variation %} - – {{ pos.variation }} - {% endif %} - - + {{ pos.item.name }}{% if pos.variation %} + – {{ pos.variation }} + {% endif %} +

-
- + {% endfor %}
diff --git a/src/pretix/control/templates/pretixcontrol/orders/export.html b/src/pretix/control/templates/pretixcontrol/orders/export.html index 00d957d43d..c019988f7a 100644 --- a/src/pretix/control/templates/pretixcontrol/orders/export.html +++ b/src/pretix/control/templates/pretixcontrol/orders/export.html @@ -11,17 +11,14 @@ {% endif %} {% for e in exporters %} -
-
+
+

- + {{ e.verbose_name }} +

-
-
+ +
-
+ {% endfor %} {% endblock %} diff --git a/src/pretix/presale/templates/pretixpresale/base.html b/src/pretix/presale/templates/pretixpresale/base.html index 3b66226719..149f77ff59 100644 --- a/src/pretix/presale/templates/pretixpresale/base.html +++ b/src/pretix/presale/templates/pretixpresale/base.html @@ -25,9 +25,9 @@ - + {% endcompress %} @@ -37,7 +37,7 @@ {% block custom_header %}{% endblock %} - + {% block above %} {% endblock %}
diff --git a/src/pretix/presale/templates/pretixpresale/event/checkout_addons.html b/src/pretix/presale/templates/pretixpresale/event/checkout_addons.html index c2ca6c03d1..17d3c28a7e 100644 --- a/src/pretix/presale/templates/pretixpresale/event/checkout_addons.html +++ b/src/pretix/presale/templates/pretixpresale/event/checkout_addons.html @@ -9,19 +9,16 @@ {% csrf_token %}
{% for form in forms %} -
-
+
+

- - {{ form.item.name }}{% if form.variation %} - – {{ form.variation }} - {% endif %} - - + {{ form.item.name }}{% if form.variation %} + – {{ form.variation }} + {% endif %} +

-
- + {% endfor %}
diff --git a/src/pretix/presale/templates/pretixpresale/event/checkout_base.html b/src/pretix/presale/templates/pretixpresale/event/checkout_base.html index 1420da0fb8..70cdb36639 100644 --- a/src/pretix/presale/templates/pretixpresale/event/checkout_base.html +++ b/src/pretix/presale/templates/pretixpresale/event/checkout_base.html @@ -3,28 +3,26 @@ {% load bootstrap3 %} {% block title %}{% trans "Checkout" %}{% endblock %} {% block content %} -
-
+
+

- + + + {% trans "Your cart" %} + + + + {% if cart.minutes_left > 0 or cart.seconds_left > 0 %} + {{ cart.minutes_left|stringformat:"02d" }}:{{ cart.seconds_left|stringformat:"02d" }} + {% else %} + {% trans "Cart expired" %} + {% endif %} + + +

-
-
+ +
{% include "pretixpresale/event/fragment_cart.html" with cart=cart event=request.event %} @@ -38,7 +36,7 @@
-
+

{% trans "Checkout" %}

{% include "pretixpresale/event/fragment_checkoutflow.html" %} {% block inner %} diff --git a/src/pretix/presale/templates/pretixpresale/event/checkout_questions.html b/src/pretix/presale/templates/pretixpresale/event/checkout_questions.html index c9f77d31df..f9f123647e 100644 --- a/src/pretix/presale/templates/pretixpresale/event/checkout_questions.html +++ b/src/pretix/presale/templates/pretixpresale/event/checkout_questions.html @@ -11,64 +11,57 @@ {% csrf_token %}
-
-
+
+

- - {% trans "Contact information" %} - - + {% trans "Contact information" %} +

-
-
+ +
{% bootstrap_form contact_form layout="horizontal" %}
-
+ {% if event.settings.invoice_address_asked %} -
-
+
+

- - {% trans "Invoice information" %}{% if not event.settings.invoice_address_required and not event.settings.invoice_name_required %} - {% trans "(optional)" %} - {% endif %} - - - + {% trans "Invoice information" %}{% if not event.settings.invoice_address_required and not event.settings.invoice_name_required %} + {% trans "(optional)" %} + {% endif %} + +

-
-
+ +
{% bootstrap_form invoice_form layout="horizontal" %}
-
+ {% endif %} {% for pos, forms in formgroups %} -
- -
+ +
{% if pos.addons.all %}
@@ -93,7 +86,7 @@ {% endfor %}
-
+ {% endfor %}
diff --git a/src/pretix/presale/templates/pretixpresale/event/index.html b/src/pretix/presale/templates/pretixpresale/event/index.html index dd8a3f2b6b..08f16dda75 100644 --- a/src/pretix/presale/templates/pretixpresale/event/index.html +++ b/src/pretix/presale/templates/pretixpresale/event/index.html @@ -16,28 +16,26 @@ {% endautoescape %} {% if show_cart %} -
-
+
+

- + + + {% trans "Your cart" %} + + + + {% if cart.minutes_left > 0 or cart.seconds_left > 0 %} + {{ cart.minutes_left|stringformat:"02d" }}:{{ cart.seconds_left|stringformat:"02d" }} + {% else %} + {% trans "Cart expired" %} + {% endif %} + + +

-
-
+ +
{% include "pretixpresale/event/fragment_cart.html" with cart=cart event=request.event editable=True %} @@ -79,7 +77,7 @@
-
+ {% endif %} {% if show_dates %} diff --git a/src/pretix/presale/templates/pretixpresale/event/order_modify.html b/src/pretix/presale/templates/pretixpresale/event/order_modify.html index c7cfed39d8..ec38b7e848 100644 --- a/src/pretix/presale/templates/pretixpresale/event/order_modify.html +++ b/src/pretix/presale/templates/pretixpresale/event/order_modify.html @@ -18,38 +18,33 @@ Please contact us if you need a new invoice. {% endblocktrans %}
-
-
+
+

- - {% trans "Invoice information" %}{% if not event.settings.invoice_address_required %} - {% trans "(optional)" %} - {% endif %} - - + {% trans "Invoice information" %}{% if not event.settings.invoice_address_required %} + {% trans "(optional)" %} + {% endif %} +

-
- + {% endif %} {% for pos, forms in formgroups %} -
-
+
+

- - {{ pos.item.name }}{% if pos.variation %} - – {{ pos.variation }} - {% endif %} - - + {{ pos.item.name }}{% if pos.variation %} + – {{ pos.variation }} + {% endif %} +

-
- + {% endfor %}
diff --git a/src/pretix/static/pretixpresale/js/ui/details.js b/src/pretix/static/pretixbase/js/details.js similarity index 91% rename from src/pretix/static/pretixpresale/js/ui/details.js rename to src/pretix/static/pretixbase/js/details.js index 357e86a373..41f9b40dbb 100644 --- a/src/pretix/static/pretixpresale/js/ui/details.js +++ b/src/pretix/static/pretixbase/js/details.js @@ -14,12 +14,14 @@ $(function () { return false; } if (isOpen) { + $details.removeClass("details-open"); $detailsNotSummary.stop().show().slideUp(500, function () { $details.prop("open", false); }); } else { $detailsNotSummary.stop().hide(); $details.prop("open", true); + $details.addClass("details-open"); $detailsNotSummary.slideDown(); } e.preventDefault(); @@ -40,6 +42,8 @@ $(function () { $details.prop('open', typeof $details.attr('open') == 'string'); if (!$details.prop('open')) { $detailsNotSummary.hide(); + } else { + $details.addClass("details-open"); } $detailsSummary.attr({ 'role': 'button', diff --git a/src/pretix/static/pretixcontrol/js/ui/main.js b/src/pretix/static/pretixcontrol/js/ui/main.js index f0b01924d7..3e60756588 100644 --- a/src/pretix/static/pretixcontrol/js/ui/main.js +++ b/src/pretix/static/pretixcontrol/js/ui/main.js @@ -367,6 +367,8 @@ var form_handlers = function (el) { $(function () { "use strict"; + $("body").removeClass("nojs"); + $("[data-formset]").formset( { animateForms: true, diff --git a/src/pretix/static/pretixcontrol/scss/main.scss b/src/pretix/static/pretixcontrol/scss/main.scss index 3f53ee5616..d040336468 100644 --- a/src/pretix/static/pretixcontrol/scss/main.scss +++ b/src/pretix/static/pretixcontrol/scss/main.scss @@ -406,7 +406,7 @@ body.loading #wrapper { transform: rotate(180deg); } -.panel-title a[data-toggle="collapse"] { +.panel-title a[data-toggle="collapse"], details h3.panel-title, details h4.panel-title { display: flex; padding: 10px 15px; margin: -10px -15px; @@ -570,3 +570,25 @@ ul.pagination { .table-payment-providers > tbody > tr > td { vertical-align: middle; } + + +details { + list-style: none; +} +details > summary::-webkit-details-marker { + display: none; +} + +details summary { + -moz-user-select: none; + -ms-user-select: none; + -webkit-user-select: none; + user-select: none; +} +.nojs details[open] .collapse-indicator, details.details-open .collapse-indicator { + -webkit-transform: rotate(180deg); + -ms-transform: rotate(180deg); + -moz-transform: rotate(180deg); + transform: rotate(180deg); +} + diff --git a/src/pretix/static/pretixpresale/js/ui/main.js b/src/pretix/static/pretixpresale/js/ui/main.js index 4647011c3b..fa7f510c87 100644 --- a/src/pretix/static/pretixpresale/js/ui/main.js +++ b/src/pretix/static/pretixpresale/js/ui/main.js @@ -97,6 +97,8 @@ var form_handlers = function (el) { $(function () { "use strict"; + $("body").removeClass("nojs"); + $("input[data-toggle=radiocollapse]").change(function () { $($(this).attr("data-parent")).find(".collapse.in").collapse('hide'); $($(this).attr("data-target")).collapse('show'); diff --git a/src/pretix/static/pretixpresale/scss/_event.scss b/src/pretix/static/pretixpresale/scss/_event.scss index 4db96f55a1..d47c222205 100644 --- a/src/pretix/static/pretixpresale/scss/_event.scss +++ b/src/pretix/static/pretixpresale/scss/_event.scss @@ -65,19 +65,6 @@ line-height: inherit; } } -details.item-with-variations { - list-style: none; -} -details.item-with-variations > summary::-webkit-details-marker { - display: none; -} - -details summary { - -moz-user-select: none; - -ms-user-select: none; - -webkit-user-select: none; - user-select: none; -} .radio .variation-description { padding-left: 20px; diff --git a/src/pretix/static/pretixpresale/scss/main.scss b/src/pretix/static/pretixpresale/scss/main.scss index 0c486f246c..1891233bb9 100644 --- a/src/pretix/static/pretixpresale/scss/main.scss +++ b/src/pretix/static/pretixpresale/scss/main.scss @@ -201,7 +201,7 @@ body.loading .container { transform: rotate(180deg); } -.panel-title a[data-toggle="collapse"] { +.panel-title a[data-toggle="collapse"], details h3.panel-title, details h4.panel-title { display: flex; padding: 10px 15px; margin: -10px -15px; @@ -219,5 +219,26 @@ body.loading .container { background-color: darken($btn-primary-bg, 10%); } + +details { + list-style: none; +} +details > summary::-webkit-details-marker { + display: none; +} + +details summary { + -moz-user-select: none; + -ms-user-select: none; + -webkit-user-select: none; + user-select: none; +} +.nojs details[open] .collapse-indicator, details.details-open .collapse-indicator { + -webkit-transform: rotate(180deg); + -ms-transform: rotate(180deg); + -moz-transform: rotate(180deg); + transform: rotate(180deg); +} + @import "_iframe.scss"; @import "_a11y.scss";