Fix UI indentation error – add copy-id button
This commit is contained in:
+4
-2
@@ -307,9 +307,11 @@ def ui_index():
|
|||||||
for e in entries:
|
for e in entries:
|
||||||
rendered = _render_markdown(e["text"])
|
rendered = _render_markdown(e["text"])
|
||||||
short_id = e["id"][:8]
|
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>'
|
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>'
|
f'<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'<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>'
|
'<button class="del-btn" type="submit">delete</button></form></div>'
|
||||||
f'<div class="entry-text">{rendered}</div>'
|
f'<div class="entry-text">{rendered}</div>'
|
||||||
"</div>"
|
"</div>"
|
||||||
|
|||||||
Reference in New Issue
Block a user