Fix UI indentation error – add copy-id button

This commit is contained in:
2026-06-12 14:38:20 +00:00
parent ca8b74d724
commit cee2e50836
+4 -2
View File
@@ -307,9 +307,11 @@ def ui_index():
for e in entries:
rendered = _render_markdown(e["text"])
short_id = e["id"][:8]
# Build the HTML card for each entry
card = (
f'<div class="entry-header"><span class="entry-id">{_html.escape(short_id)}</span>'
'<button class="copy-btn" type="button" onclick="navigator.clipboard.writeText(\'{_html.escape(e["id"])}\')">copy id</button>'
'<form method="post" action="/-/delete/' + _html.escape(e['id']) + '" style="margin:0" onsubmit="return confirm(\'Delete this entry?\')">'
f'<button class="copy-btn" type="button" onclick="navigator.clipboard.writeText(\'{_html.escape(e["id"])}\')">copy id</button>'
f'<form method="post" action="/-/delete/{_html.escape(e["id"])}" style="margin:0" onsubmit="return confirm(\'Delete this entry?\')">'
'<button class="del-btn" type="submit">delete</button></form></div>'
f'<div class="entry-text">{rendered}</div>'
"</div>"