1
0
Fork 0
forked from bton/matekasse
matekasse/Website/templates/list.html

52 lines
1.6 KiB
HTML
Raw Normal View History

2024-02-21 21:02:07 +00:00
{% extends "base.html" %}
{% block title %}
Strichliste
{% endblock %}
{% block customscript %}
<script type="text/javascript" charset="utf-8">
2024-09-09 08:12:24 +00:00
function play() {
return new Promise((resolve, reject) => {
var audio = new Audio('/ka-ching.wav');
audio.play();
audio.addEventListener("ended", function(){
resolve()
});
});
}
async function ka_ching(element) {
await play();
element.parentElement.submit();
}
2024-02-21 21:02:07 +00:00
var socket = io();
socket.on("update", function () {
window.location = "http://matekasse.server.c3h/list"
});
</script>
{% endblock %}
{% block content %}
<form action="/list/user" method="get"><input name="user" type="search" placeholder="Search for user">
<button>Search</button>
</form>
<form action="/adduser" method="post">
<button type="submit">Add User</button>
</form>
<br></br>
2024-06-01 20:04:26 +00:00
{% for user in users %}
2024-02-21 21:02:07 +00:00
<form action="/change" method="post" style="display: inline;">
<p style="display: inline;">
<a href="list/user?id={{user[0]}}">{{user[1]|limit_length}}</a>: {{user[2]/100}}€
2024-02-21 21:02:07 +00:00
</p>
2024-06-01 20:04:26 +00:00
<input name="id" type="hidden" value="{{user[0]}}">
<input name="change" type="number" lang="nb" step="0.01" max={{50000-user[2]/100}} min={{min_value-user[2]/100}} placeholder="add to balance">
2024-02-21 21:02:07 +00:00
</form>
<form action="/change" method="post" style="display: inline">
2024-06-01 20:04:26 +00:00
<input name="id" type="hidden" value="{{user[0]}}">
2024-09-09 08:12:24 +00:00
<input name="change" value={{preis}} type="hidden">
<button onclick="ka_ching(this)" type="button">{{preis}}€</button>
2024-02-21 21:02:07 +00:00
</form>
<br style="line-height: 50%;"></br>
{% endfor %}
{% endblock %}