2022-11-04 20:35:28 +01:00
|
|
|
{% extends "baselayout.html" %}
|
2022-03-16 12:11:30 +01:00
|
|
|
|
|
|
|
{% load i18n %}
|
2022-05-16 10:51:22 +02:00
|
|
|
{% load l10n %}
|
2022-03-16 12:11:30 +01:00
|
|
|
|
|
|
|
{% block title %}
|
|
|
|
{% translate "Drinks - Order" %}
|
|
|
|
{% endblock %}
|
|
|
|
|
|
|
|
{% block headAdditional %}
|
2022-11-04 20:35:28 +01:00
|
|
|
<link rel="stylesheet" href="/static/css/appform.css">
|
|
|
|
<link rel="stylesheet" href="/static/css/custom_number_input.css">
|
2022-03-16 12:11:30 +01:00
|
|
|
{% endblock %}
|
|
|
|
|
|
|
|
|
|
|
|
{% block content %}
|
|
|
|
|
|
|
|
{% if drink and drink.available > 0 and not drink.deleted %}
|
|
|
|
|
|
|
|
{% if user.balance > 0 or user.allow_order_with_negative_balance %}
|
|
|
|
|
2022-11-04 20:35:28 +01:00
|
|
|
<form id="orderform" class="appform">
|
2022-03-16 12:11:30 +01:00
|
|
|
{% csrf_token %}
|
|
|
|
|
2022-11-04 20:35:28 +01:00
|
|
|
<h1 class="formheading">{% translate "Order" %}</h1>
|
2022-03-16 12:11:30 +01:00
|
|
|
|
2022-11-04 20:35:28 +01:00
|
|
|
<div class="forminfo">
|
|
|
|
<span>{% translate "Drink" %}:</span>
|
|
|
|
<span>{{ drink.product_name }}</span>
|
|
|
|
</div>
|
|
|
|
<div class="forminfo">
|
|
|
|
<span>{% translate "Price per Item" %} ({{ currency_suffix }}):</span>
|
|
|
|
<span id="priceperdrink" data-drink-price="{% localize off %}{{ drink.price }}{% endlocalize %}">
|
|
|
|
{{ drink.price }}
|
|
|
|
</span>
|
2022-03-16 12:11:30 +01:00
|
|
|
</div>
|
|
|
|
|
2022-05-24 18:49:04 +02:00
|
|
|
{% if not drink.do_not_count %}
|
2022-11-04 20:35:28 +01:00
|
|
|
<div class="forminfo">
|
|
|
|
<span>{% translate "Available" %}:</span>
|
|
|
|
<span>{{ drink.available }}</span>
|
2022-03-16 12:11:30 +01:00
|
|
|
</div>
|
|
|
|
{% endif %}
|
|
|
|
|
2022-11-04 20:35:28 +01:00
|
|
|
<div class="forminfo">
|
|
|
|
<span>{% translate "Sum" %} ({{ currency_suffix }}):</span>
|
|
|
|
<span id="ordercalculatedsum">{{ drink.price }}</span>
|
2022-03-16 12:11:30 +01:00
|
|
|
</div>
|
|
|
|
|
2022-11-04 20:35:28 +01:00
|
|
|
<div class="forminput">
|
|
|
|
<span>{% translate "Count" %}:</span>
|
|
|
|
<span class="customnumberinput">
|
|
|
|
<button type="button" class="customnumberinput-minus" id="numberofdrinks-btn-minus">-</button>
|
|
|
|
{% if drink.do_not_count %}
|
|
|
|
<input type="number" class="customnumberinput-field" name="numberofdrinks" id="numberofdrinks"
|
|
|
|
min="1" max="100" value="1">
|
|
|
|
{% else %}
|
|
|
|
<input type="number" class="customnumberinput-field" name="numberofdrinks" id="numberofdrinks"
|
|
|
|
max="{{ drink.available }}" min="1" max="100" value="1">
|
|
|
|
{% endif %}
|
|
|
|
<button type="button" class="customnumberinput-plus" id="numberofdrinks-btn-plus">+</button>
|
|
|
|
</span>
|
2022-03-16 12:11:30 +01:00
|
|
|
</div>
|
|
|
|
|
2022-11-04 20:35:28 +01:00
|
|
|
<div id="statusinfo"></div>
|
|
|
|
|
|
|
|
<input type="hidden" name="drinkid" id="drinkid" value="{{ drink.id }}">
|
2022-03-16 12:11:30 +01:00
|
|
|
|
2022-11-04 20:35:28 +01:00
|
|
|
<div class="formbuttons">
|
2022-03-16 12:11:30 +01:00
|
|
|
<a href="/" class="button">{% translate "cancel" %}</a>
|
2022-11-04 20:35:28 +01:00
|
|
|
<input type="submit" id="ordersubmitbtn" class="button" value='{% translate "order" %}'>
|
2022-03-16 12:11:30 +01:00
|
|
|
</div>
|
|
|
|
|
|
|
|
</form>
|
|
|
|
|
|
|
|
|
|
|
|
<script src="/static/js/order.js"></script>
|
2022-11-04 20:35:28 +01:00
|
|
|
<script src="/static/js/custom_number_input.js"></script>
|
2022-03-16 12:11:30 +01:00
|
|
|
|
|
|
|
{% else %}
|
|
|
|
|
2022-11-04 20:35:28 +01:00
|
|
|
<div class="centeringflex">
|
2022-06-13 19:13:27 +02:00
|
|
|
<p>{% translate "Your balance is too low to order a drink." %}</p>
|
2022-03-16 12:11:30 +01:00
|
|
|
<a href="/">{% translate "back" %}</a>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
{% endif %}
|
|
|
|
|
|
|
|
{% else %}
|
|
|
|
|
2022-11-04 20:35:28 +01:00
|
|
|
<div class="centeringflex">
|
2022-03-16 12:11:30 +01:00
|
|
|
<p>{% translate "This drink is not available." %}</p>
|
|
|
|
<a href="/">{% translate "back" %}</a>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
{% endif %}
|
|
|
|
|
2022-08-06 17:33:31 +02:00
|
|
|
<script src="/static/js/autoreload.js"></script>
|
|
|
|
|
2022-03-16 12:11:30 +01:00
|
|
|
{% endblock %}
|