Redesigned the user interface #23
This commit is contained in:
parent
f7048d1e9f
commit
d93591bcb2
32 changed files with 846 additions and 1297 deletions
|
@ -1,9 +1,6 @@
|
|||
<!DOCTYPE html>
|
||||
|
||||
{% load i18n %}
|
||||
|
||||
<html lang="en">
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
|
@ -13,44 +10,27 @@
|
|||
<title>{% block title %}{% endblock %}</title>
|
||||
{% block headAdditional %}{% endblock %}
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<div class="baselayout">
|
||||
|
||||
<div class="baselayout flex flex-column">
|
||||
{% include "globalmessage.html" %}
|
||||
|
||||
{% if user.is_authenticated %}
|
||||
|
||||
{% include "userpanel.html" %}
|
||||
|
||||
{% endif %}
|
||||
|
||||
<main>
|
||||
|
||||
<main class="flex flex-column">
|
||||
{% if user.is_authenticated or "accounts/login/" in request.path or "accounts/logout/" in request.path or "admin/logout/" in request.path %}
|
||||
|
||||
<div class="content">
|
||||
{% block content %}{% endblock %}
|
||||
</div>
|
||||
|
||||
<div class="content flex flex-column">
|
||||
{% block content %}{% endblock %}
|
||||
</div>
|
||||
{% else %}
|
||||
|
||||
<div class="centeringflex">
|
||||
{% translate "An error occured. Please log out and log in again." %}
|
||||
<br>
|
||||
<a href="/accounts/logout">log out</a>
|
||||
</div>
|
||||
|
||||
<div class="flex flex-center">
|
||||
{% translate "An error occured. Please log out and log in again." %}
|
||||
<br>
|
||||
<a href="/accounts/logout">log out</a>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
</main>
|
||||
|
||||
{% include "footer.html" %}
|
||||
|
||||
</div>
|
||||
|
||||
<script src="/static/js/main.js"></script>
|
||||
|
||||
</body>
|
||||
</html>
|
|
@ -3,45 +3,34 @@
|
|||
{% load i18n %}
|
||||
|
||||
{% block title %}
|
||||
{% translate "Drinks - Deposit" %}
|
||||
{% translate "Drinks - Deposit" %}
|
||||
{% endblock %}
|
||||
|
||||
{% block headAdditional %}
|
||||
<link rel="stylesheet" href="/static/css/appform.css">
|
||||
<link rel="stylesheet" href="/static/css/simple-keyboard.css">
|
||||
<link rel="stylesheet" href="/static/css/simple-keyboard_dark.css">
|
||||
<link rel="stylesheet" href="/static/css/simple-keyboard.css">
|
||||
<link rel="stylesheet" href="/static/css/simple-keyboard_dark.css">
|
||||
{% endblock %}
|
||||
|
||||
|
||||
{% block content %}
|
||||
|
||||
<form id="depositform" class="appform">
|
||||
{% csrf_token %}
|
||||
|
||||
<h1 class="formheading">{% translate "Deposit" %}</h1>
|
||||
|
||||
<div class="forminput">
|
||||
<span>{% translate "Amount" %} {{ currency_suffix }}:</span>
|
||||
<span>
|
||||
<input type="number" name="depositamount" id="depositamount" class="keyboard-input" max="9999.99" min="1.00" step="0.01" autofocus>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<div id="statusinfo"></div>
|
||||
|
||||
<div class="formbuttons">
|
||||
<a href="/" class="button">{% translate "cancel" %}</a>
|
||||
<input type="submit" id="depositsubmitbtn" class="button" value='{% translate "confirm" %}'>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
|
||||
<form id="depositform" class="flex flex-column flex-center appform gap-1rem">
|
||||
{% csrf_token %}
|
||||
<h1 class="formheading">{% translate "Deposit" %}</h1>
|
||||
<div class="flex forminput">
|
||||
<span>{% translate "Amount" %} {{ currency_suffix }}:</span>
|
||||
<span>
|
||||
<input type="number" name="depositamount" id="depositamount" class="keyboard-input" max="9999.99" min="1.00" step="0.01" autofocus>
|
||||
</span>
|
||||
</div>
|
||||
<div id="statusinfo"></div>
|
||||
<!-- Virtual Keyboard -->
|
||||
<div id="keyboard" class="simple-keyboard" data-layout="numeric"></div>
|
||||
<script src="/static/js/simple-keyboard.js"></script>
|
||||
<script src="/static/js/simple-keyboard_configure.js"></script>
|
||||
|
||||
<script src="/static/js/deposit.js"></script>
|
||||
<script src="/static/js/autoreload.js"></script>
|
||||
|
||||
{% endblock %}
|
||||
<div class="flex-center buttons">
|
||||
<a href="/" class="button">{% translate "cancel" %}</a>
|
||||
<input type="submit" id="depositsubmitbtn" class="button" value='{% translate "confirm" %}'>
|
||||
</div>
|
||||
</form>
|
||||
<script src="/static/js/deposit.js"></script>
|
||||
<script src="/static/js/autoreload.js"></script>
|
||||
{% endblock %}
|
|
@ -1,8 +1,7 @@
|
|||
{% load i18n %}
|
||||
|
||||
<footer class="footer-container">
|
||||
<div class="footer">
|
||||
<div class="flex flex-row flex-center flex-wrap footer">
|
||||
<div>Version {{ app_version }}</div>
|
||||
<div>Copyright (C) 2021, Julian Müller (ChaoticByte)</div>
|
||||
</div>
|
||||
</footer>
|
||||
</footer>
|
|
@ -1,5 +1,5 @@
|
|||
{% if global_message != "" %}
|
||||
<div class="globalmessage">
|
||||
<div class="flex flex-center globalmessage">
|
||||
<div>{{ global_message }}</div>
|
||||
</div>
|
||||
{% endif %}
|
|
@ -3,35 +3,26 @@
|
|||
{% load i18n %}
|
||||
|
||||
{% block title %}
|
||||
{% translate "Drinks - History" %}
|
||||
{% translate "Drinks - History" %}
|
||||
{% endblock %}
|
||||
|
||||
{% block headAdditional %}
|
||||
<link rel="stylesheet" href="/static/css/history.css">
|
||||
{% endblock %}
|
||||
|
||||
|
||||
{% block content %}
|
||||
|
||||
<h1 class="heading">{% translate "History" %}</h1>
|
||||
|
||||
{% if history %}
|
||||
<table class="history">
|
||||
<tr>
|
||||
<th>{% translate "last 30 actions" %}</th>
|
||||
<th></th>
|
||||
</tr>
|
||||
{% for h in history %}
|
||||
<tr>
|
||||
<td>{{ h.0 }}</td>
|
||||
<td class="historydate">{{ h.1 }}</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</table>
|
||||
{% else %}
|
||||
{% translate "No history." %}
|
||||
{% endif %}
|
||||
|
||||
<script src="/static/js/autoreload.js"></script>
|
||||
|
||||
{% endblock %}
|
||||
<h1>{% translate "History" %}</h1>
|
||||
{% if history %}
|
||||
<table class="history">
|
||||
<tr>
|
||||
<th>{% translate "last 30 actions" %}</th>
|
||||
<th></th>
|
||||
</tr>
|
||||
{% for h in history %}
|
||||
<tr>
|
||||
<td>{{ h.0 }}</td>
|
||||
<td class="historydate">{{ h.1 }}</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</table>
|
||||
{% else %}
|
||||
{% translate "No history." %}
|
||||
{% endif %}
|
||||
<script src="/static/js/autoreload.js"></script>
|
||||
{% endblock %}
|
|
@ -3,45 +3,33 @@
|
|||
{% load i18n %}
|
||||
|
||||
{% block title %}
|
||||
{% translate "Drinks - Home" %}
|
||||
{% endblock %}
|
||||
|
||||
{% block headAdditional %}
|
||||
<link rel="stylesheet" href="/static/css/index.css">
|
||||
{% translate "Drinks - Home" %}
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
|
||||
<h1 class="heading">{% translate "Available Drinks" %}</h1>
|
||||
|
||||
{% if available_drinks %}
|
||||
|
||||
<ul class="availabledrinkslist">
|
||||
{% for drink in available_drinks %}
|
||||
{% if drink.do_not_count %}
|
||||
<li>
|
||||
<a class="button" href="/order/{{ drink.id }}">
|
||||
<span>{{ drink }}</span>
|
||||
<span>{% translate "available" %}</span>
|
||||
</a>
|
||||
</li>
|
||||
{% else %}
|
||||
<li>
|
||||
<a class="button" href="/order/{{ drink.id }}">
|
||||
<span>{{ drink }}</span>
|
||||
<span>{{ drink.available }} {% translate "available" %}</span>
|
||||
</a>
|
||||
</li>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</ul>
|
||||
|
||||
<h1>{% translate "Available Drinks" %}</h1>
|
||||
{% if available_drinks %}
|
||||
<ul class="flex flex-row flex-wrap gap-1rem drinks-list">
|
||||
{% for drink in available_drinks %}
|
||||
{% if drink.do_not_count %}
|
||||
<li class="flex">
|
||||
<a class="button flex flex-row flex-center gap-1rem" href="/order/{{ drink.id }}">
|
||||
<span>{{ drink }}</span>
|
||||
<span>{% translate "available" %}</span>
|
||||
</a>
|
||||
</li>
|
||||
{% else %}
|
||||
|
||||
{% translate "No drinks available." %}
|
||||
|
||||
<li class="flex">
|
||||
<a class="button flex flex-row flex-center gap-1rem" href="/order/{{ drink.id }}">
|
||||
<span>{{ drink }}</span>
|
||||
<span>{{ drink.available }} {% translate "available" %}</span>
|
||||
</a>
|
||||
</li>
|
||||
{% endif %}
|
||||
|
||||
<script src="/static/js/autoreload.js"></script>
|
||||
|
||||
{% endblock %}
|
||||
{% endfor %}
|
||||
</ul>
|
||||
{% else %}
|
||||
{% translate "No drinks available." %}
|
||||
{% endif %}
|
||||
<script src="/static/js/autoreload.js"></script>
|
||||
{% endblock %}
|
|
@ -7,94 +7,68 @@
|
|||
{% translate "Drinks - Order" %}
|
||||
{% endblock %}
|
||||
|
||||
{% block headAdditional %}
|
||||
<link rel="stylesheet" href="/static/css/appform.css">
|
||||
<link rel="stylesheet" href="/static/css/custom_number_input.css">
|
||||
{% endblock %}
|
||||
|
||||
|
||||
{% block content %}
|
||||
|
||||
{% if drink and drink.available > 0 and not drink.deleted %}
|
||||
|
||||
{% if user.balance > 0 or user.allow_order_with_negative_balance %}
|
||||
|
||||
<form id="orderform" class="appform">
|
||||
{% csrf_token %}
|
||||
|
||||
<h1 class="formheading">{% translate "Order" %}</h1>
|
||||
|
||||
<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>
|
||||
</div>
|
||||
|
||||
{% if not drink.do_not_count %}
|
||||
<div class="forminfo">
|
||||
<span>{% translate "Available" %}:</span>
|
||||
<span>{{ drink.available }}</span>
|
||||
</div>
|
||||
<div class="flex flex-column flex-center">
|
||||
{% if drink and drink.available > 0 and not drink.deleted %}
|
||||
{% if user.balance > 0 or user.allow_order_with_negative_balance %}
|
||||
<form id="orderform" class="flex flex-column flex-center appform gap-1rem">
|
||||
{% csrf_token %}
|
||||
<h1 class="formheading">{% translate "Order" %}</h1>
|
||||
<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>
|
||||
</div>
|
||||
{% if not drink.do_not_count %}
|
||||
<div class="forminfo">
|
||||
<span>{% translate "Available" %}:</span>
|
||||
<span>{{ drink.available }}</span>
|
||||
</div>
|
||||
{% endif %}
|
||||
<div class="forminfo">
|
||||
<span>{% translate "Sum" %} ({{ currency_suffix }}):</span>
|
||||
<span id="ordercalculatedsum">{{ drink.price }}</span>
|
||||
</div>
|
||||
<div class="flex forminput">
|
||||
<span>{% translate "Count" %}:</span>
|
||||
<span class="flex flex-row 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 %}
|
||||
|
||||
<div class="forminfo">
|
||||
<span>{% translate "Sum" %} ({{ currency_suffix }}):</span>
|
||||
<span id="ordercalculatedsum">{{ drink.price }}</span>
|
||||
</div>
|
||||
|
||||
<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>
|
||||
</div>
|
||||
|
||||
<div id="statusinfo"></div>
|
||||
|
||||
<input type="hidden" name="drinkid" id="drinkid" value="{{ drink.id }}">
|
||||
|
||||
<div class="formbuttons">
|
||||
<a href="/" class="button">{% translate "cancel" %}</a>
|
||||
<input type="submit" id="ordersubmitbtn" class="button" value='{% translate "order" %}'>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
|
||||
|
||||
<script src="/static/js/order.js"></script>
|
||||
<script src="/static/js/custom_number_input.js"></script>
|
||||
|
||||
{% else %}
|
||||
|
||||
<div class="centeringflex">
|
||||
<p>{% translate "Your balance is too low to order a drink." %}</p>
|
||||
<a href="/">{% translate "back" %}</a>
|
||||
</div>
|
||||
|
||||
{% endif %}
|
||||
|
||||
{% else %}
|
||||
|
||||
<div class="centeringflex">
|
||||
<button type="button" class="customnumberinput-plus" id="numberofdrinks-btn-plus">+</button>
|
||||
</span>
|
||||
</div>
|
||||
<div id="statusinfo"></div>
|
||||
<input type="hidden" name="drinkid" id="drinkid" value="{{ drink.id }}">
|
||||
<div class="buttons">
|
||||
<a href="/" class="button">{% translate "cancel" %}</a>
|
||||
<input type="submit" id="ordersubmitbtn" class="button" value='{% translate "order" %}'>
|
||||
</div>
|
||||
</form>
|
||||
<script src="/static/js/order.js"></script>
|
||||
<script src="/static/js/custom_number_input.js"></script>
|
||||
{% else %}
|
||||
<div class="flex flex-center">
|
||||
<p>{% translate "Your balance is too low to order a drink." %}</p>
|
||||
<a href="/">{% translate "back" %}</a>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% else %}
|
||||
<div class="flex flex-center">
|
||||
<p>{% translate "This drink is not available." %}</p>
|
||||
<a href="/">{% translate "back" %}</a>
|
||||
</div>
|
||||
|
||||
{% endif %}
|
||||
|
||||
{% endif %}
|
||||
<script src="/static/js/autoreload.js"></script>
|
||||
|
||||
{% endblock %}
|
||||
</div>
|
||||
{% endblock %}
|
|
@ -1,24 +1,19 @@
|
|||
|
||||
{% extends "baselayout.html" %}
|
||||
|
||||
{% load i18n %}
|
||||
|
||||
{% block title %}
|
||||
{% translate "Drinks - Logged Out" %}
|
||||
{% translate "Drinks - Logged Out" %}
|
||||
{% endblock %}
|
||||
|
||||
{% block headAdditional %}
|
||||
<link rel="stylesheet" href="/static/css/login.css">
|
||||
<link rel="stylesheet" href="/static/css/login.css">
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
|
||||
<div class="centeringflex">
|
||||
{% translate "Logged out! You will be redirected shortly." %}
|
||||
<br><br>
|
||||
<a href="/">{% translate "Click here if automatic redirection does not work." %}</a>
|
||||
</div>
|
||||
|
||||
<script src="/static/js/logged_out.js"></script>
|
||||
|
||||
{% endblock %}
|
||||
<div class="flex flex-center flex-column gap-1rem">
|
||||
{% translate "Logged out! You will be redirected shortly." %}
|
||||
<a href="/">{% translate "Click here if automatic redirection does not work." %}</a>
|
||||
</div>
|
||||
<script src="/static/js/logged_out.js"></script>
|
||||
{% endblock %}
|
|
@ -5,66 +5,56 @@
|
|||
{% load static %}
|
||||
|
||||
{% block title %}
|
||||
{% translate "Drinks - Login" %}
|
||||
{% translate "Drinks - Login" %}
|
||||
{% endblock %}
|
||||
|
||||
{% block headAdditional %}
|
||||
<link rel="stylesheet" href="/static/css/login.css">
|
||||
<link rel="stylesheet" href="/static/css/simple-keyboard.css">
|
||||
<link rel="stylesheet" href="/static/css/simple-keyboard_dark.css">
|
||||
<link rel="stylesheet" href="/static/css/simple-keyboard.css">
|
||||
<link rel="stylesheet" href="/static/css/simple-keyboard_dark.css">
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
|
||||
{% if error_message %}
|
||||
<p class="errortext">{{ error_message }}</p>
|
||||
{% endif %}
|
||||
|
||||
<div class="passwordoverlaycontainer nodisplay" id="passwordoverlaycontainer">
|
||||
<div class="passwordoverlay">
|
||||
<form method="post" action="{% url 'login' %}" class="loginform">
|
||||
{% csrf_token %}
|
||||
<h1>{% translate "Log in" %}</h1>
|
||||
<input type="text" name="username" autofocus="" autocapitalize="none" autocomplete="username" maxlength="150" required="" id="id_username">
|
||||
<input type="password" name="password" autocomplete="current-password" required="" id="id_password" class="keyboard-input" placeholder='{% translate "Password/PIN" %}'>
|
||||
<div class="horizontalbuttonlist">
|
||||
<button type="button" id="pwocancel">{% translate "cancel" %}</button>
|
||||
<input class="button" id="submit_login" type="submit" value='{% translate "login" %}' />
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<!-- Virtual Keyboard -->
|
||||
{% get_current_language as LANGUAGE_CODE %}
|
||||
<div id="keyboard" class="simple-keyboard" data-layout="{{LANGUAGE_CODE}}"></div>
|
||||
<script src="/static/js/simple-keyboard.js"></script>
|
||||
<script src="/static/js/simple-keyboard_configure.js"></script>
|
||||
{% if error_message %}
|
||||
<p class="errortext">{{ error_message }}</p>
|
||||
{% endif %}
|
||||
<div class="flex flex-column gap-1rem nodisplay" id="passwordoverlay-container">
|
||||
<div class="passwordoverlay">
|
||||
<h1>{% translate "Log in" %}</h1>
|
||||
<form method="post" action="{% url 'login' %}" class="flex flex-center loginform">
|
||||
{% csrf_token %}
|
||||
<input type="text" name="username" autofocus="" autocapitalize="none" autocomplete="username" maxlength="150" required="" id="id_username">
|
||||
<input type="password" name="password" autocomplete="current-password" required="" id="id_password" class="keyboard-input" placeholder='{% translate "Password/PIN" %}'>
|
||||
<div class="buttons">
|
||||
<button type="button" id="pwocancel">{% translate "cancel" %}</button>
|
||||
<input class="button" id="submit_login" type="submit" value='{% translate "login" %}' />
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<!-- Virtual Keyboard -->
|
||||
{% get_current_language as LANGUAGE_CODE %}
|
||||
<div id="keyboard" class="simple-keyboard" data-layout="{{LANGUAGE_CODE}}"></div>
|
||||
<script src="/static/js/simple-keyboard.js"></script>
|
||||
<script src="/static/js/simple-keyboard_configure.js"></script>
|
||||
</div>
|
||||
<div class="flex flex-column flex-center">
|
||||
<h1>{% translate "Choose your account" %}</h1>
|
||||
|
||||
<div class="userlistcontainer" id="userlistcontainer">
|
||||
<ul class="userlist">
|
||||
{% for user_ in user_list %}
|
||||
<li class="userlistbutton button" data-username="{{ user_.username }}">
|
||||
<img src="/profilepictures/{{ user_.profile_picture_filename|urlencode }}">
|
||||
<div>
|
||||
{% if user_.first_name %}
|
||||
|
||||
{% if user_.last_name %}
|
||||
{{ user_.last_name }},
|
||||
{% endif %}
|
||||
|
||||
{{ user_.first_name }}
|
||||
|
||||
{% else %}
|
||||
{{ user_.username }}
|
||||
{% endif %}
|
||||
</div>
|
||||
</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<script src="/static/js/login.js"></script>
|
||||
|
||||
{% endblock %}
|
||||
<ul class="flex flex-center flex-wrap userlist">
|
||||
{% for user_ in user_list %}
|
||||
<li class="flex flex-center userlistbutton button" data-username="{{ user_.username }}">
|
||||
<img src="/profilepictures/{{ user_.profile_picture_filename|urlencode }}">
|
||||
<div class="flex flex-center">
|
||||
{% if user_.first_name %}
|
||||
{% if user_.last_name %}
|
||||
{{ user_.last_name }},
|
||||
{% endif %}
|
||||
{{ user_.first_name }}
|
||||
{% else %}
|
||||
{{ user_.username }}
|
||||
{% endif %}
|
||||
</div>
|
||||
</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
</div>
|
||||
<script src="/static/js/login.js"></script>
|
||||
{% endblock %}
|
|
@ -3,146 +3,62 @@
|
|||
{% load i18n %}
|
||||
|
||||
{% block title %}
|
||||
{% translate "Drinks - Statistics" %}
|
||||
{% translate "Drinks - Statistics" %}
|
||||
{% endblock %}
|
||||
|
||||
{% block headAdditional %}
|
||||
<link rel="stylesheet" href="/static/css/statistics.css">
|
||||
{% endblock %}
|
||||
|
||||
|
||||
{% block content %}
|
||||
|
||||
<h1 class="heading">{% translate "Statistics" %}</h1>
|
||||
|
||||
<div class="maincontainer">
|
||||
|
||||
<div class="tablescontainer">
|
||||
|
||||
<div id="noyopd" class="statisticstable">
|
||||
<h1>{% translate "Your orders per drink" %}</h1>
|
||||
{% if noyopd %}
|
||||
<table>
|
||||
<tr>
|
||||
<th>{% translate "drink" %}</th>
|
||||
<th>{% translate "count" %}</th>
|
||||
</tr>
|
||||
{% for row in noyopd %}
|
||||
<tr>
|
||||
<td>{{ row.0 }}</td>
|
||||
<td>{{ row.1 }}</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</table>
|
||||
{% else %}
|
||||
<div>{% translate "No history." %}</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
<div id="noaopd" class="statisticstable">
|
||||
<h1>{% translate "All orders per drink" %}</h1>
|
||||
{% if noaopd %}
|
||||
<table>
|
||||
<tr>
|
||||
<th>{% translate "drink" %}</th>
|
||||
<th>{% translate "count" %}</th>
|
||||
</tr>
|
||||
{% for row in noaopd %}
|
||||
<tr>
|
||||
<td>{{ row.0 }}</td>
|
||||
<td>{{ row.1 }}</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</table>
|
||||
{% else %}
|
||||
<div>{% translate "No history." %}</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
<div id="yopml12m" class="statisticstable">
|
||||
<h1>{% translate "Your orders per month (last 12 months)" %}</h1>
|
||||
{% if yopml12m %}
|
||||
<table>
|
||||
<tr>
|
||||
<th>{% translate "month" %}</th>
|
||||
<th>{% translate "count" %}</th>
|
||||
</tr>
|
||||
{% for row in yopml12m %}
|
||||
<tr>
|
||||
<td>{{ row.0 }}</td>
|
||||
<td>{{ row.1 }}</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</table>
|
||||
{% else %}
|
||||
<div>{% translate "No history." %}</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
<div id="aopml12m" class="statisticstable">
|
||||
<h1>{% translate "All orders per month (last 12 months)" %}</h1>
|
||||
{% if aopml12m %}
|
||||
<table>
|
||||
<tr>
|
||||
<th>{% translate "month" %}</th>
|
||||
<th>{% translate "count" %}</th>
|
||||
</tr>
|
||||
{% for row in aopml12m %}
|
||||
<tr>
|
||||
<td>{{ row.0 }}</td>
|
||||
<td>{{ row.1 }}</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</table>
|
||||
{% else %}
|
||||
<div>{% translate "No history." %}</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
<div id="yopwd" class="statisticstable">
|
||||
<h1>{% translate "Your orders per weekday" %}</h1>
|
||||
{% if yopwd %}
|
||||
<table>
|
||||
<tr>
|
||||
<th>{% translate "day" %}</th>
|
||||
<th>{% translate "count" %}</th>
|
||||
</tr>
|
||||
{% for row in yopwd %}
|
||||
<tr>
|
||||
<td>{{ row.0 }}</td>
|
||||
<td>{{ row.1 }}</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</table>
|
||||
{% else %}
|
||||
<div>{% translate "No history." %}</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
<div id="aopwd" class="statisticstable">
|
||||
<h1>{% translate "All orders per weekday" %}</h1>
|
||||
{% if aopwd %}
|
||||
<table>
|
||||
<tr>
|
||||
<th>{% translate "day" %}</th>
|
||||
<th>{% translate "count" %}</th>
|
||||
</tr>
|
||||
{% for row in aopwd %}
|
||||
<tr>
|
||||
<td>{{ row.0 }}</td>
|
||||
<td>{{ row.1 }}</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</table>
|
||||
{% else %}
|
||||
<div>{% translate "No history." %}</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<h1>{% translate "Statistics" %}</h1>
|
||||
<div>
|
||||
<div class="flex flex-column flex-center">
|
||||
<h3>{% translate "Orders per drink" %}</h3>
|
||||
<table>
|
||||
<tr>
|
||||
<th>{% translate "drink" %}</th>
|
||||
<th>{% translate "you" %}</th>
|
||||
<th>{% translate "all" %}</th>
|
||||
</tr>
|
||||
{% for key, values in orders_per_drink.items %}
|
||||
<tr>
|
||||
<td>{{ key }}</td>
|
||||
<td>{{ values.a|default:"0" }}</td>
|
||||
<td>{{ values.b|default:"0" }}</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<script src="/static/js/autoreload.js"></script>
|
||||
|
||||
{% endblock %}
|
||||
<div class="flex flex-column flex-center">
|
||||
<h3>{% translate "Orders per month (last 12 months)" %}</h3>
|
||||
<table>
|
||||
<tr>
|
||||
<th>{% translate "month" %}</th>
|
||||
<th>{% translate "you" %}</th>
|
||||
<th>{% translate "all" %}</th>
|
||||
</tr>
|
||||
{% for key, values in orders_per_month.items %}
|
||||
<tr>
|
||||
<td>{{ key }}</td>
|
||||
<td>{{ values.a|default:"0" }}</td>
|
||||
<td>{{ values.b|default:"0" }}</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</table>
|
||||
</div>
|
||||
<div class="flex flex-column flex-center">
|
||||
<h3>{% translate "Orders per weekday" %}</h3>
|
||||
<table>
|
||||
<tr>
|
||||
<th>{% translate "day" %}</th>
|
||||
<th>{% translate "you" %}</th>
|
||||
<th>{% translate "all" %}</th>
|
||||
</tr>
|
||||
{% for key, values in orders_per_weekday.items %}
|
||||
<tr>
|
||||
<td>{{ key }}</td>
|
||||
<td>{{ values.a|default:"0" }}</td>
|
||||
<td>{{ values.b|default:"0" }}</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</table>
|
||||
</div>
|
||||
<script src="/static/js/autoreload.js"></script>
|
||||
{% endblock %}
|
|
@ -7,56 +7,36 @@
|
|||
{% translate "Drinks - Supply" %}
|
||||
{% endblock %}
|
||||
|
||||
{% block headAdditional %}
|
||||
<link rel="stylesheet" href="/static/css/appform.css">
|
||||
<link rel="stylesheet" href="/static/css/custom_number_input.css">
|
||||
{% endblock %}
|
||||
|
||||
|
||||
{% block content %}
|
||||
|
||||
{% if user.is_superuser or user.allowed_to_supply %}
|
||||
|
||||
<form id="supplyform" class="appform">
|
||||
{% csrf_token %}
|
||||
|
||||
<h1 class="formheading">{% translate "Supply" %}</h1>
|
||||
|
||||
<div class="forminput">
|
||||
<span>{% translate "Description" %}:</span>
|
||||
<span>
|
||||
<input type="text" name="supplydescription" id="supplydescription" autofocus>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<div class="forminput">
|
||||
<span>{% translate "Price" %} ({{ currency_suffix }}):</span>
|
||||
<span>
|
||||
<input type="number" name="supplyprice" id="supplyprice" max="9999.99" min="1.00" step="0.01">
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<div id="statusinfo"></div>
|
||||
|
||||
<div class="formbuttons">
|
||||
<a href="/" class="button">{% translate "cancel" %}</a>
|
||||
<input type="submit" id="supplysubmitbtn" class="button" value='{% translate "submit" %}'>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
|
||||
<script src="/static/js/supply.js"></script>
|
||||
<script src="/static/js/custom_number_input.js"></script>
|
||||
|
||||
{% else %}
|
||||
|
||||
<div class="centeringflex">
|
||||
<p>{% translate "You are not allowed to view this site." %}</p>
|
||||
<a href="/">{% translate "back" %}</a>
|
||||
{% if user.is_superuser or user.allowed_to_supply %}
|
||||
<form id="supplyform" class="flex flex-column flex-center appform gap-1rem">
|
||||
{% csrf_token %}
|
||||
<h1 class="formheading">{% translate "Supply" %}</h1>
|
||||
<div class="flex forminput">
|
||||
<span>{% translate "Description" %}:</span>
|
||||
<span>
|
||||
<input type="text" name="supplydescription" id="supplydescription" autofocus>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
{% endif %}
|
||||
|
||||
<script src="/static/js/autoreload.js"></script>
|
||||
|
||||
{% endblock %}
|
||||
<div class="flex forminput">
|
||||
<span>{% translate "Price" %} ({{ currency_suffix }}):</span>
|
||||
<span>
|
||||
<input type="number" name="supplyprice" id="supplyprice" max="9999.99" min="1.00" step="0.01">
|
||||
</span>
|
||||
</div>
|
||||
<div id="statusinfo"></div>
|
||||
<div class="buttons">
|
||||
<a href="/" class="button">{% translate "cancel" %}</a>
|
||||
<input type="submit" id="supplysubmitbtn" class="button" value='{% translate "submit" %}'>
|
||||
</div>
|
||||
</form>
|
||||
<script src="/static/js/supply.js"></script>
|
||||
<script src="/static/js/custom_number_input.js"></script>
|
||||
{% else %}
|
||||
<div class="flex flex-center">
|
||||
<p>{% translate "You are not allowed to view this site." %}</p>
|
||||
<a href="/">{% translate "back" %}</a>
|
||||
</div>
|
||||
{% endif %}
|
||||
<script src="/static/js/autoreload.js"></script>
|
||||
{% endblock %}
|
|
@ -1,24 +1,24 @@
|
|||
{% load i18n %}
|
||||
{% load static %}
|
||||
|
||||
<div class="userpanel">
|
||||
<div class="flex flex-center userpanel">
|
||||
<div class="userinfo">
|
||||
<img src="/profilepictures/{{ user.profile_picture_filename|urlencode }}">
|
||||
<span>
|
||||
{% if user.first_name != "" %}
|
||||
{% translate "User" %}: {{ user.first_name }} {{ user.last_name }} ({{ user.username }})
|
||||
{% translate "User" %}: {{ user.first_name }} {{ user.last_name }} ({{ user.username }})
|
||||
{% else %}
|
||||
{% translate "User" %}: {{ user.username }}
|
||||
{% translate "User" %}: {{ user.username }}
|
||||
{% endif %}
|
||||
-
|
||||
{% if user.balance < 0.01 %}
|
||||
<span class="userbalancewarn">{% translate "Balance" %}: {{ user.balance }}{{ currency_suffix }}</span>
|
||||
<span class="userbalancewarn">{% translate "Balance" %}: {{ user.balance }}{{ currency_suffix }}</span>
|
||||
{% else %}
|
||||
<span>{% translate "Balance" %}: {{ user.balance }}{{ currency_suffix }}</span>
|
||||
<span>{% translate "Balance" %}: {{ user.balance }}{{ currency_suffix }}</span>
|
||||
{% endif %}
|
||||
</span>
|
||||
</div>
|
||||
<div class="horizontalbuttonlist">
|
||||
<div class="flex flex-row flex-center flex-wrap userpanel-buttons">
|
||||
<a class="button" href="/">Home</a>
|
||||
<a class="button" href="/deposit">{% translate "Deposit" %}</a>
|
||||
<a class="button" href="/accounts/logout">{% translate "Logout" %}</a>
|
||||
|
@ -30,13 +30,13 @@
|
|||
<a class="button dropdownchoice" href="/history">{% translate "History" %}</a>
|
||||
<a class="button dropdownchoice" href="/statistics">{% translate "Statistics" %}</a>
|
||||
{% if user.is_superuser or user.is_staff %}
|
||||
<a class="button dropdownchoice" href="/admin/">Admin Panel</a>
|
||||
<a class="button dropdownchoice" href="/admin/">Admin Panel</a>
|
||||
{% endif %}
|
||||
{% if user.is_superuser or user.allowed_to_supply %}
|
||||
<a class="button dropdownchoice" href="/supply/">{% translate "Supply" %}</a>
|
||||
<a class="button dropdownchoice" href="/supply/">{% translate "Supply" %}</a>
|
||||
{% endif %}
|
||||
<a class="button dropdownchoice" href="/accounts/password_change/">{% translate "Change Password" %}</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
Loading…
Add table
Add a link
Reference in a new issue