diff options
author | Riley L. <riley@e926.de> | 2024-11-03 20:58:57 +0100 |
---|---|---|
committer | Riley L. <riley@e926.de> | 2024-11-03 20:58:57 +0100 |
commit | 2482b3bb97b17a06d4027cb247381e8afbc56f29 (patch) | |
tree | 02148173817b7291f288fcbd1e34b90d89751c14 /abrechenbarkeit.lua | |
parent | 20c3a25e43eca445b34329547a619a874ea7fbd4 (diff) | |
download | abrechenbarkeit-2482b3bb97b17a06d4027cb247381e8afbc56f29.tar abrechenbarkeit-2482b3bb97b17a06d4027cb247381e8afbc56f29.tar.bz2 abrechenbarkeit-2482b3bb97b17a06d4027cb247381e8afbc56f29.tar.zst |
add printing design for lists; add some currency
Diffstat (limited to 'abrechenbarkeit.lua')
-rwxr-xr-x | abrechenbarkeit.lua | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/abrechenbarkeit.lua b/abrechenbarkeit.lua index 17e08f4..84fafc7 100755 --- a/abrechenbarkeit.lua +++ b/abrechenbarkeit.lua @@ -248,7 +248,7 @@ local function r_user(username) <form action="" method="POST"> <input type="number" name="amount" id="amount" value="%d" hidden /> <input type="text" name="comment" id="comment" value="" hidden /> - <input type="submit" value="%s%.02f€" class="amount-%s" /> + <input type="submit" value="%s%.02f€" class="amount-%s button" /> </form> ]], amount * type, ({ [-1] = "-", [1] = "+" })[type], amount / 100, ({ [-1] = "neg", [1] = "pos" })[type])) @@ -257,18 +257,18 @@ local function r_user(username) print("</div>") print([[ <form class="transaction box backgroundbox" action="" method="POST"> - <h3>Create Transaction</h3> - <label for="amount">Amount: </label> + <h3>Create 🏳️⚧️✊</h3> + <label for="amount">Amount (ct): </label> <input type="number" name="amount" id="amount" /> <label for="comment">Comment: </label> <input type="text" name="comment" id="comment" /> - <input type="submit" value="Update" /> + <input type="submit" value="Update" class="amount-ntr button" /> </form> <form class="transaction box backgroundbox" action="" method="POST" id="buy_product"> <h3>Buy Product</h3> <label for="product">Product: </label> <input type="text" name="product" id="product" /> - <input type="submit" value="Buy" /> + <input class="amount-neg button" type="submit" value="Buy" /> </form> ]]) print("</div>") @@ -277,7 +277,7 @@ end local function r_log(filter) return respond(200, "Abrechnungen", function() - print("<table>") + print([[<table class="log">]]) print("<tr><th>Time</th><th>Username</th><th>Amount</th><th>P.-Barcode</th><th>P.-Count</th><th>Comment</th></tr>") for time, username, amount, pcode, pcount, comment in read_log() do if filter == nil or filter == username then @@ -293,7 +293,7 @@ local function r_log(filter) <form action="/%s" method="POST"> <input type="number" name="amount" id="amount" value="%d" hidden /> <input type="text" name="comment" id="comment" value="Revert %s" hidden /> - <input type="submit" value="Revert" /> + <input type="submit" class="amount-ntr button" value="Revert" /> </form> </td> </tr> @@ -403,8 +403,8 @@ local function r_products() <input type="text" name="barcode" id="barcode" /> <label for="name">Name: </label> <input type="text" name="name" id="name" /> - <label for="price">Price: </label> - <input type="number" name="price" id="price" /> + <label for="price">Price (ct): </label> + <input type="number" name="price" id="price" unit="cent"/> <input type="submit" value="Add" /> </form> <form action="/?products" method="POST" class="box backgroundbox"> @@ -416,7 +416,7 @@ local function r_products() </form> </div> ]]) - print("<table><tr><th>Name</th><th>Price</th><th>Barcode</th><th>Count</th></tr>") + print([[<table class="productlist"><tr><th>Name</th><th>Price</th><th>Barcode</th><th>Count</th></tr>]]) local pbals = product_balances() for barcode, price, name in read_products() do print(string.format([[ |