mirror of
https://codeberg.org/metamuffin/abrechenbarkeit.git
synced 2025-05-23 06:44:45 +00:00
fix/add wraping on user page
This commit is contained in:
parent
bc069cecc4
commit
48cbf9adcd
2 changed files with 45 additions and 30 deletions
|
@ -467,8 +467,9 @@ local function r_user(username)
|
||||||
{ time = format_duration(os.time() - last_txn), username = urlencode(username) }))
|
{ time = format_duration(os.time() - last_txn), username = urlencode(username) }))
|
||||||
print([[</div>]])
|
print([[</div>]])
|
||||||
end
|
end
|
||||||
print([[<div class="transactions container firstchildlarge">]])
|
print([[
|
||||||
print([[<div class="amount-presets backgroundbox">]])
|
<ul class="userforms"><li>
|
||||||
|
<div class="amount-presets backgroundbox">]])
|
||||||
for _, type in ipairs({ 1, -1 }) do
|
for _, type in ipairs({ 1, -1 }) do
|
||||||
for _, amount in ipairs({ 50, 100, 150, 200, 500, 1000 }) do
|
for _, amount in ipairs({ 50, 100, 150, 200, 500, 1000 }) do
|
||||||
local a = amount * type
|
local a = amount * type
|
||||||
|
@ -486,14 +487,32 @@ local function r_user(username)
|
||||||
}))
|
}))
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
print("</div>")
|
print("</div></li>")
|
||||||
print(format([[
|
print(format([[
|
||||||
<form class="transaction box backgroundbox {disable_class}" action="" method="POST">
|
<li><form class="transaction box backgroundbox {disable_class}" action="" method="POST">
|
||||||
|
<h3>{+user.form.transaction}</h3>
|
||||||
|
<input type="text" name="user_dst" value="{!username}" hidden />
|
||||||
|
<label for="amount">{+field.amount}: </label>
|
||||||
|
<input type="number" name="amount" id="amount" />
|
||||||
|
<label for="comment">{+field.comment}: </label>
|
||||||
|
<input type="text" name="comment" id="comment" />
|
||||||
|
<input type="submit" value="{+user.form.transaction.submit}" class="amount-ntr button" />
|
||||||
|
</form></li>
|
||||||
|
<li><form class="transaction box backgroundbox {disable_class}" action="" method="POST" id="buy_product">
|
||||||
|
<h3>{+user.form.buy}</h3>
|
||||||
|
<input type="text" name="user_dst" value="{!username}" hidden />
|
||||||
|
<input type="text" name="negate_pcount" value="1" hidden />
|
||||||
|
<label for="pcount">{+field.count}: </label>
|
||||||
|
<input type="number" name="pcount" id="pcount" value="1" />
|
||||||
|
<label for="pcode">{+field.barcode}: </label>
|
||||||
|
<input type="text" name="pcode" id="pcode" />
|
||||||
|
<input class="amount-neg button" type="submit" value="{+user.form.buy.submit}" />
|
||||||
|
</form></li>
|
||||||
|
<li><form class="transaction box backgroundbox {disable_class}" action="" method="POST">
|
||||||
<h3>{+user.form.transfer}</h3>
|
<h3>{+user.form.transfer}</h3>
|
||||||
<label for="user_dst">{+field.destination}: </label>
|
<label for="user_dst">{+field.destination}: </label>
|
||||||
<select name="user_dst">]], {
|
<select name="user_dst">]],
|
||||||
username = username,
|
{ username = username, disable_class = is_special and "disabled" or "" }))
|
||||||
}))
|
|
||||||
local users = get_active_users();
|
local users = get_active_users();
|
||||||
for _, u in ipairs(users) do
|
for _, u in ipairs(users) do
|
||||||
if u.name ~= username then
|
if u.name ~= username then
|
||||||
|
@ -508,27 +527,8 @@ local function r_user(username)
|
||||||
<label for="comment">{+field.comment}: </label>
|
<label for="comment">{+field.comment}: </label>
|
||||||
<input type="text" name="comment" id="comment" />
|
<input type="text" name="comment" id="comment" />
|
||||||
<input type="submit" value="{+user.form.transfer.submit}" class="amount-ntr button" />
|
<input type="submit" value="{+user.form.transfer.submit}" class="amount-ntr button" />
|
||||||
</form>
|
</form></li>
|
||||||
<form class="transaction box backgroundbox {disable_class}" action="" method="POST">
|
<li><form class="transaction box backgroundbox {disable_class}" action="" method="POST" id="buy_product">
|
||||||
<h3>{+user.form.transaction}</h3>
|
|
||||||
<input type="text" name="user_dst" value="{!username}" hidden />
|
|
||||||
<label for="amount">{+field.amount}: </label>
|
|
||||||
<input type="number" name="amount" id="amount" />
|
|
||||||
<label for="comment">{+field.comment}: </label>
|
|
||||||
<input type="text" name="comment" id="comment" />
|
|
||||||
<input type="submit" value="{+user.form.transaction.submit}" class="amount-ntr button" />
|
|
||||||
</form>
|
|
||||||
<form class="transaction box backgroundbox {disable_class}" action="" method="POST" id="buy_product">
|
|
||||||
<h3>{+user.form.buy}</h3>
|
|
||||||
<input type="text" name="user_dst" value="{!username}" hidden />
|
|
||||||
<input type="text" name="negate_pcount" value="1" hidden />
|
|
||||||
<label for="pcount">{+field.count}: </label>
|
|
||||||
<input type="number" name="pcount" id="pcount" value="1" />
|
|
||||||
<label for="pcode">{+field.barcode}: </label>
|
|
||||||
<input type="text" name="pcode" id="pcode" />
|
|
||||||
<input class="amount-neg button" type="submit" value="{+user.form.buy.submit}" />
|
|
||||||
</form>
|
|
||||||
<form class="transaction box backgroundbox {disable_class}" action="" method="POST" id="buy_product">
|
|
||||||
<h3>{+user.form.restock}</h3>
|
<h3>{+user.form.restock}</h3>
|
||||||
<input type="text" name="user_dst" value="{!username}" hidden />
|
<input type="text" name="user_dst" value="{!username}" hidden />
|
||||||
<label for="pcount">{+field.count}: </label>
|
<label for="pcount">{+field.count}: </label>
|
||||||
|
@ -538,9 +538,9 @@ local function r_user(username)
|
||||||
<label for="pcode">{+field.barcode}: </label>
|
<label for="pcode">{+field.barcode}: </label>
|
||||||
<input type="text" name="pcode" id="pcode" />
|
<input type="text" name="pcode" id="pcode" />
|
||||||
<input type="submit" value="{+user.form.restock.submit}" class="button amount-pos" />
|
<input type="submit" value="{+user.form.restock.submit}" class="button amount-pos" />
|
||||||
</form>
|
</form></li>
|
||||||
]], { username = username, disable_class = is_special and "disabled" or "" }))
|
]], { username = username, disable_class = is_special and "disabled" or "" }))
|
||||||
print("</div>")
|
print("</ul>")
|
||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
15
style.css
15
style.css
|
@ -266,6 +266,21 @@ h3 {
|
||||||
margin-left: 0;
|
margin-left: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ul.userforms {
|
||||||
|
content: '';
|
||||||
|
display: table;
|
||||||
|
clear: both;
|
||||||
|
list-style: none;
|
||||||
|
margin-left: 0.5rem;
|
||||||
|
padding: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
ul.userforms > li {
|
||||||
|
width: fit-content;
|
||||||
|
float: left;
|
||||||
|
padding: 0.5rem;
|
||||||
|
}
|
||||||
|
|
||||||
.backgroundbox {
|
.backgroundbox {
|
||||||
width: fit-content;
|
width: fit-content;
|
||||||
background-color: var(--b0);
|
background-color: var(--b0);
|
||||||
|
|
Loading…
Add table
Reference in a new issue