This commit is contained in:
bton 2024-06-01 22:04:26 +02:00
parent 79a31ab6d5
commit 14624a4f6e
2 changed files with 6 additions and 6 deletions

View file

@ -63,7 +63,7 @@ def create_app(test_config=None):
c = db.cursor()
c.execute("SELECT * FROM users")
users = c.fetchall()
return render_template("list.html", users=users, preis=(preis/100))
return render_template("list.html", users=users, preis=(preis/100), min_value=-50000)
@app.route("/transactionlist")
def transactionlist():

View file

@ -18,16 +18,16 @@ Strichliste
<button type="submit">Add User</button>
</form>
<br></br>
{% for i in users %}
{% for user in users %}
<form action="/change" method="post" style="display: inline;">
<p style="display: inline;">
<a href="list/user?id={{i[0]}}">{{i[1]}}</a>: {{i[2]/100}}€
<a href="list/user?id={{user[0]}}">{{user[1]}}</a>: {{user[2]/100}}€
</p>
<input name="id" type="hidden" value="{{i[0]}}">
<input name="change" type="number" lang="nb" step="0.01" max="50000" min="-50000" placeholder="add to balance">
<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">
</form>
<form action="/change" method="post" style="display: inline">
<input name="id" type="hidden" value="{{i[0]}}">
<input name="id" type="hidden" value="{{user[0]}}">
<button type="submit" name="change" value={{preis}}>{{preis}}€</button>
</form>
<br style="line-height: 50%;"></br>