feat: filter and search by tag

This commit is contained in:
2026-02-03 09:53:08 +01:00
parent cb11e34798
commit 229223f77a
9 changed files with 147 additions and 14 deletions

View File

@ -11,9 +11,12 @@
</form>
<div class="meta-tags">
{{ range .Note.Tags }}
<form method="POST" action="/notes/{{ $.Note.ID }}/tags/{{ . }}" class="tag-remove-form">
<button type="submit" class="tag">{{ . }} ×</button>
</form>
<span class="tag-chip">
<a class="tag-link" href="/?tag={{ . | urlquery }}">{{ . }}</a>
<form method="POST" action="/notes/{{ $.Note.ID }}/tags/{{ . | urlquery }}" class="tag-remove-form">
<button type="submit" class="tag-remove" aria-label="Remove tag {{ . }}">×</button>
</form>
</span>
{{ end }}
</div>
</section>

View File

@ -23,6 +23,7 @@
{{ define "renderSearch" }}
{{ if ne .SearchTerm "" }}<h2>Matching results for query '{{ .SearchTerm }}'</h2>{{ end }}
{{ if ne .TagFilter "" }}<h2>Filtered by tag '{{ .TagFilter }}'</h2>{{ end }}
<ul class="search-results">
{{ range .Notes }}
<li {{ if eq .ID $.LastActive }}class="active-note"{{ end }}>