Add a "needs review" flag with a sidebar filter
Links can be bookmarked for a later look via a toggle button on the card (🏷️/🔖), shown with a yellow border while flagged. A new sidebar section "Merkliste" links to /?review=1, filtering to just the flagged links; the count updates live via the existing facets query. Since the project has no migration framework, add a minimal startup check that ALTER TABLEs in the needs_review column for existing SQLite databases (create_all only creates missing tables). Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
@@ -19,7 +19,7 @@
|
||||
<div class="layout">
|
||||
<aside class="sidebar">
|
||||
<div class="panel">
|
||||
<a href="/?sort={{ sort }}" class="facet {% if not active_category and not active_manufacturer %}active{% endif %}">
|
||||
<a href="/?sort={{ sort }}" class="facet {% if not active_category and not active_manufacturer and not review_only %}active{% endif %}">
|
||||
<span>📚 Alle Links</span>
|
||||
</a>
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
<h3>Kategorien</h3>
|
||||
{% for name, count in facets.categories %}
|
||||
<a href="/?category={{ name | urlencode }}&sort={{ sort }}"
|
||||
class="facet {% if active_category == name %}active{% endif %}">
|
||||
class="facet {% if active_category == name and not review_only %}active{% endif %}">
|
||||
<span>{{ name }}</span><span class="count">{{ count }}</span>
|
||||
</a>
|
||||
{% else %}
|
||||
@@ -39,13 +39,20 @@
|
||||
<h3>Hersteller / Quellen</h3>
|
||||
{% for name, count in facets.manufacturers %}
|
||||
<a href="/?manufacturer={{ name | urlencode }}&sort={{ sort }}"
|
||||
class="facet {% if active_manufacturer == name %}active{% endif %}">
|
||||
class="facet {% if active_manufacturer == name and not review_only %}active{% endif %}">
|
||||
<span>{{ name }}</span><span class="count">{{ count }}</span>
|
||||
</a>
|
||||
{% else %}
|
||||
<div class="muted" style="font-size:.85rem; padding:4px 8px;">noch keine</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
|
||||
<div class="facet-group">
|
||||
<h3>Merkliste</h3>
|
||||
<a href="/?review=1&sort={{ sort }}" class="facet {% if review_only %}active{% endif %}">
|
||||
<span>🔖 Zur Durchsicht</span><span class="count">{{ facets.review_count }}</span>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</aside>
|
||||
|
||||
@@ -71,6 +78,7 @@
|
||||
<form id="searchform" onsubmit="return false;" style="margin:0;">
|
||||
<input type="hidden" name="category" value="{{ active_category }}">
|
||||
<input type="hidden" name="manufacturer" value="{{ active_manufacturer }}">
|
||||
<input type="hidden" name="review" value="{{ '1' if review_only else '' }}">
|
||||
<input type="text" name="q" value="{{ q }}"
|
||||
placeholder="🔍 Suche in Titel, Zusammenfassung, Tags..."
|
||||
hx-get="/search" hx-target="#links" hx-swap="innerHTML"
|
||||
|
||||
Reference in New Issue
Block a user