2018-07-07 15:11:27 +02:00
|
|
|
{% extends "base.html" %}
|
|
|
|
|
|
|
|
{% block header %}
|
2018-07-23 00:19:41 +02:00
|
|
|
{# Show the username. #}
|
|
|
|
<h1>Welcome, {{ authuser.name }}</h1>
|
|
|
|
{{ super() }}
|
2018-07-07 15:11:27 +02:00
|
|
|
{% endblock %}
|
|
|
|
|
|
|
|
{% block main %}
|
|
|
|
|
2018-07-23 00:19:41 +02:00
|
|
|
{# Show the users current balance #}
|
|
|
|
Your balance: {{ authuser.balance|chf }}
|
|
|
|
<br/>
|
2021-04-07 02:41:53 +02:00
|
|
|
{# Logout link #}
|
2020-02-03 20:44:58 +01:00
|
|
|
<div class="thumblist-item">
|
2021-04-07 02:41:53 +02:00
|
|
|
<a href="/logout">Logout</a>
|
2020-02-03 20:44:58 +01:00
|
|
|
</div>
|
2021-04-07 02:41:53 +02:00
|
|
|
{# Links to deposit two common amounts of cash. TODO: Will be replaced by a nicer UI later (#20) #}
|
|
|
|
<div id="depositlist">
|
|
|
|
<div class="thumblist-item">
|
|
|
|
<a href="/deposit?n=100">Deposit CHF 1</a>
|
|
|
|
</div>
|
|
|
|
<div class="thumblist-item">
|
|
|
|
<a href="/deposit?n=1000">Deposit CHF 10</a>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div id="deposit-wrapper">
|
2022-07-16 19:15:25 +02:00
|
|
|
<div id="deposit-input">
|
|
|
|
<div id="deposit-output">
|
|
|
|
<span id="deposit-title"></span>
|
|
|
|
<span id="deposit-amount">0.00</span>
|
|
|
|
</div>
|
|
|
|
{% for i in [('1', '1'), ('2', '2'), ('3', '3'), ('4', '4'), ('5', '5'), ('6', '6'), ('7', '7'), ('8', '8'), ('9', '9'), ('del', '✗'), ('0', '0'), ('ok', '✓')] %}
|
|
|
|
<div class="numpad" id="numpad-{{ i.0 }}" onclick="deposit_key('{{ i.0 }}');">{{ i.1 }}</div>
|
|
|
|
{% endfor %}
|
|
|
|
<div id="transfer-userlist">
|
|
|
|
<div id="scroll-up" onclick="scrollUserlist(-130);">▲</div>
|
|
|
|
<ul id="transfer-userlist-list">
|
|
|
|
{% for user in ((users if user != authuser) | sort(attribute='name')) %}
|
|
|
|
<li onclick="set_transfer_user(this, {{ user.id }})">{{ user.name }}</li>
|
|
|
|
{% endfor %}
|
|
|
|
</ul>
|
|
|
|
<div id="scroll-down" onclick="scrollUserlist(+130);">▼</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
2020-02-03 20:44:58 +01:00
|
|
|
</div>
|
2021-04-07 02:41:53 +02:00
|
|
|
<script src="/static/js/depositlist.js"></script>
|
2020-02-03 20:44:58 +01:00
|
|
|
<br/>
|
2018-07-23 00:19:41 +02:00
|
|
|
|
|
|
|
{% for product in products %}
|
|
|
|
{# Show an item per product, consisting of the name, image, price and stock, triggering a purchase on click #}
|
|
|
|
<div class="thumblist-item">
|
2021-04-07 09:36:18 +02:00
|
|
|
{% if product.custom_price %}
|
|
|
|
<a onclick="setup_custom_price({{ product.id }}, '{{ product.name}}');">
|
|
|
|
{% else %}
|
2018-07-23 00:19:41 +02:00
|
|
|
<a href="/buy?pid={{ product.id }}">
|
2021-04-07 09:36:18 +02:00
|
|
|
{% endif %}
|
2018-07-23 00:19:41 +02:00
|
|
|
<span class="thumblist-title">{{ product.name }}</span>
|
2021-04-07 09:36:18 +02:00
|
|
|
{% if product.custom_price %}
|
|
|
|
<span class="thumblist-detail">Custom Price</span><br/>
|
|
|
|
{% else %}
|
2018-07-23 00:19:41 +02:00
|
|
|
<span class="thumblist-detail">Price:
|
|
|
|
{% if authuser.is_member %}
|
|
|
|
{{ product.price_member|chf }}
|
|
|
|
{% else %}
|
|
|
|
{{ product.price_non_member|chf }}
|
|
|
|
{% endif %}
|
2020-02-03 20:44:58 +01:00
|
|
|
</span><br/>
|
2021-04-07 09:36:18 +02:00
|
|
|
{% endif %}
|
2018-07-23 00:19:41 +02:00
|
|
|
<div class="imgcontainer">
|
2021-08-07 21:06:24 +02:00
|
|
|
<img src="/static/upload/thumbnails/products/{{ product.id }}.png" alt="Picture of {{ product.name }}" draggable="false"/>
|
2021-04-07 01:25:45 +02:00
|
|
|
{% set pstock = stock.get_stock(product) %}
|
|
|
|
{% if pstock is not none %}
|
|
|
|
<span class="thumblist-stock">{{ pstock }}</span>
|
2020-12-28 09:46:51 +01:00
|
|
|
{% endif %}
|
2018-07-23 00:19:41 +02:00
|
|
|
</div>
|
|
|
|
</a>
|
2018-07-11 15:32:07 +02:00
|
|
|
</div>
|
2018-07-23 00:19:41 +02:00
|
|
|
{% endfor %}
|
|
|
|
<br/>
|
2018-07-07 15:11:27 +02:00
|
|
|
|
2018-07-23 00:19:41 +02:00
|
|
|
{{ super() }}
|
2018-07-07 15:11:27 +02:00
|
|
|
|
|
|
|
{% endblock %}
|