mirror of
https://github.com/pretix/pretix.git
synced 2026-05-19 17:34:03 +00:00
add extend button to user interface
This commit is contained in:
@@ -492,15 +492,21 @@
|
|||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-md-12">
|
<div class="col-md-12">
|
||||||
{% if not cart.is_ordered %}
|
{% if not cart.is_ordered %}
|
||||||
<p class="text-muted" id="cart-deadline" data-expires="{{ cart.first_expiry|date:"Y-m-d H:i:sO" }}">
|
<form class="text-muted"
|
||||||
{% if cart.minutes_left > 0 or cart.seconds_left > 0 %}
|
method="post" data-asynctask action="{% eventurl request.event "presale:event.cart.extend" cart_namespace=cart_namespace %}">
|
||||||
{% blocktrans trimmed with minutes=cart.minutes_left %}
|
{% csrf_token %}
|
||||||
The items in your cart are reserved for you for {{ minutes }} minutes.
|
<span id="cart-deadline" data-expires="{{ cart.first_expiry|date:"Y-m-d H:i:sO" }}">
|
||||||
{% endblocktrans %}
|
{% if cart.minutes_left > 0 or cart.seconds_left > 0 %}
|
||||||
{% else %}
|
{% blocktrans trimmed with minutes=cart.minutes_left %}
|
||||||
{% trans "The items in your cart are no longer reserved for you. You can still complete your order as long as they’re available." %}
|
The items in your cart are reserved for you for {{ minutes }} minutes.
|
||||||
{% endif %}
|
{% endblocktrans %}
|
||||||
</p>
|
{% else %}
|
||||||
|
{% trans "The items in your cart are no longer reserved for you. You can still complete your order as long as they’re available." %}
|
||||||
|
{% endif %}
|
||||||
|
</span>
|
||||||
|
<button class="btn btn-link" type="submit" id="cart-extend-button">
|
||||||
|
<i class="fa fa-refresh" aria-hidden="true"></i> {% trans "Extend" %}</button>
|
||||||
|
</form>
|
||||||
{% else %}
|
{% else %}
|
||||||
<p class="sr-only" id="cart-description">{% trans "Overview of your ordered products." %}</p>
|
<p class="sr-only" id="cart-description">{% trans "Overview of your ordered products." %}</p>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|||||||
@@ -55,6 +55,7 @@ var cart = {
|
|||||||
pad(diff_minutes.toString(), 2) + ':' + pad(diff_seconds.toString(), 2)
|
pad(diff_minutes.toString(), 2) + ':' + pad(diff_seconds.toString(), 2)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
$("#cart-extend-button").toggle(diff_minutes < 3);
|
||||||
},
|
},
|
||||||
|
|
||||||
init: function () {
|
init: function () {
|
||||||
|
|||||||
Reference in New Issue
Block a user