diff --git a/.gitignore b/.gitignore index 3564e40..ffe2fa3 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,6 @@ /* !/gnix.yaml !/readme.md -!/strichliste.lua +!/abrechenbarkeit.lua !/.gitignore !/collapse_log.lua diff --git a/strichliste.lua b/abrechenbarkeit.lua similarity index 79% rename from strichliste.lua rename to abrechenbarkeit.lua index fbdfbb5..dc3685b 100755 --- a/strichliste.lua +++ b/abrechenbarkeit.lua @@ -51,19 +51,20 @@ local path = os.getenv("PATH_INFO") local method = os.getenv("REQUEST_METHOD") local query = parse_query(os.getenv("QUERY_STRING")) -local stylesheet = [[ - /* body { background-color: #161616; } - h1, h2, h3, h4, h5, h6, p, label, a { color: #e2e2e2; } */ - .amount-presets form { display: inline-block; width: 60px } - .amount-pos { color: green; } - .amount-neg { color: red; } - nav h2 { display: inline-block } - .notif { padding: 0.5em; margin: 0.5em; background-color: #ddd; } - .notif.error { background-color: #faa; } - .notif p { margin: 5px; } - form.box { border: 2px solid grey; padding: 0.5em; margin: 0.5em; display: inline-block; } - form h3 { margin: 5px; } -]] +local stylesheet = io.open("a.css"):read("a") +-- local stylesheet = [[ +-- /* body { background-color: #161616; } +-- h1, h2, h3, h4, h5, h6, p, label, a { color: #e2e2e2; } */ +-- .amount-presets form { display: inline-block; width: 60px } +-- .amount-pos { color: green; } +-- .amount-neg { color: red; } +-- nav h2 { display: inline-block } +-- .notif { padding: 0.5em; margin: 0.5em; background-color: #ddd; } +-- .notif.error { background-color: #faa; } +-- .notif p { margin: 5px; } +-- form.box { border: 2px solid grey; padding: 0.5em; margin: 0.5em; display: inline-block; } +-- form h3 { margin: 5px; } +-- ]] local script = [[ document.addEventListener("keypress", ev => { @@ -91,10 +92,15 @@ local function respond(status, title, body)
]], escape(title), stylesheet, script, config.head_extra or "")) body() @@ -223,7 +229,7 @@ local function r_user(username) if method == "POST" then notif = r_user_post(username) end - return respond(200, string.format("Strichliste: %s", username), function() + return respond(200, string.format("Abrechenbarheit: %s", username), function() print(string.format("Current balance: %.02f€
+Current balance:%.02f€
]], balance >= 0 and "pos" or "neg", balance / 100)) print(string.format([[Last transaction added %s ago. View user log ]], format_duration(os.time() - last_txn), username)) end - print([[ -
- - ]]) - print([[Time | Username | Amount | Comment |
---|
Name | Price | Amount |
---|
Name | Price | Barcode |
---|---|---|
%s | %.02f€ | %s |