Add link editing, AI re-description, and footer
Links can now be edited manually (title, summary, category, manufacturer, tags) via an inline edit form, with a "KI neu beschreiben lassen" action that re-fetches the URL and lets the AI regenerate all fields. Editing recomputes the search embedding. Also adds an app footer showing author, version, and hostname. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
@@ -7,11 +7,17 @@
|
||||
{{ link.url }}
|
||||
</div>
|
||||
</div>
|
||||
<button class="danger"
|
||||
hx-delete="/links/{{ link.id }}"
|
||||
hx-target="#link-{{ link.id }}"
|
||||
hx-swap="outerHTML"
|
||||
hx-confirm="Diesen Link wirklich löschen?">✕</button>
|
||||
<div style="display:flex; gap:4px; flex-shrink:0;">
|
||||
<button class="ghost" style="padding:4px 10px; font-size:.8rem;"
|
||||
hx-get="/links/{{ link.id }}/edit"
|
||||
hx-target="#link-{{ link.id }}"
|
||||
hx-swap="outerHTML">✎ Bearbeiten</button>
|
||||
<button class="danger"
|
||||
hx-delete="/links/{{ link.id }}"
|
||||
hx-target="#link-{{ link.id }}"
|
||||
hx-swap="outerHTML"
|
||||
hx-confirm="Diesen Link wirklich löschen?">✕</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{% if link.summary %}
|
||||
|
||||
54
app/templates/_link_card_edit.html
Normal file
54
app/templates/_link_card_edit.html
Normal file
@@ -0,0 +1,54 @@
|
||||
<div class="panel link-card" id="link-{{ link.id }}">
|
||||
<form hx-put="/links/{{ link.id }}" hx-target="#link-{{ link.id }}" hx-swap="outerHTML"
|
||||
hx-disabled-elt="button">
|
||||
<div class="muted" style="font-size:.8rem; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; margin-bottom:8px;">
|
||||
{{ link.url }}
|
||||
</div>
|
||||
|
||||
<div class="field">
|
||||
<label>Titel</label>
|
||||
<input type="text" name="title" value="{{ link.title }}">
|
||||
</div>
|
||||
|
||||
<div class="field">
|
||||
<label>Zusammenfassung</label>
|
||||
<textarea name="summary" rows="3" style="width:100%; background:var(--panel2); border:1px solid var(--border); color:var(--text); border-radius:8px; padding:10px 12px; font-size:.95rem; font-family:inherit;">{{ link.summary }}</textarea>
|
||||
</div>
|
||||
|
||||
<div style="display:flex; gap:12px;">
|
||||
<div class="field" style="flex:1;">
|
||||
<label>Kategorie</label>
|
||||
<input type="text" name="category" value="{{ link.category }}">
|
||||
</div>
|
||||
<div class="field" style="flex:1;">
|
||||
<label>Hersteller / Quelle</label>
|
||||
<input type="text" name="manufacturer" value="{{ link.manufacturer }}">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="field">
|
||||
<label>Tags (mit Komma getrennt)</label>
|
||||
<input type="text" name="tags" value="{{ link.tag_list | join(', ') }}">
|
||||
</div>
|
||||
|
||||
<div style="display:flex; justify-content:space-between; gap:8px; margin-top:4px;">
|
||||
<div style="display:flex; gap:8px;">
|
||||
<button type="submit">Speichern</button>
|
||||
<button type="button" class="ghost"
|
||||
hx-get="/links/{{ link.id }}/view"
|
||||
hx-target="#link-{{ link.id }}"
|
||||
hx-swap="outerHTML">Abbrechen</button>
|
||||
</div>
|
||||
{% if ai_enabled %}
|
||||
<button type="button" class="ghost"
|
||||
hx-post="/links/{{ link.id }}/reanalyze"
|
||||
hx-target="#link-{{ link.id }}"
|
||||
hx-swap="outerHTML"
|
||||
hx-disabled-elt="this"
|
||||
hx-confirm="Link erneut laden und von der KI neu beschreiben lassen? Bestehende Angaben werden dabei ersetzt.">
|
||||
<span class="htmx-indicator">⏳</span> 🤖 KI neu beschreiben lassen
|
||||
</button>
|
||||
{% endif %}
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
@@ -59,9 +59,16 @@
|
||||
.htmx-indicator { opacity: 0; transition: opacity .2s; }
|
||||
.htmx-request .htmx-indicator { opacity: 1; }
|
||||
.htmx-request.htmx-indicator { opacity: 1; }
|
||||
footer.app-footer {
|
||||
text-align: center; padding: 16px 24px; margin-top: 24px;
|
||||
color: var(--muted); font-size: .8rem; border-top: 1px solid var(--border);
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
{% block body %}{% endblock %}
|
||||
<footer class="app-footer">
|
||||
© {{ app_author }} · Version {{ app_version }} · {{ app_host }}
|
||||
</footer>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
Reference in New Issue
Block a user