diff options
author | Wolfgang Müller | 2025-02-20 15:24:42 +0100 |
---|---|---|
committer | Wolfgang Müller | 2025-02-20 19:51:39 +0100 |
commit | 8e9aa5f6286a15c818a47344fc80964f5288bb52 (patch) | |
tree | b3ef187daff345eeb918ab07900cc1c4185c53e4 /frontend/src/lib/toolbar | |
parent | c6bf35aea63969b90463d6e70cb02ed61e4e3270 (diff) | |
download | hircine-8e9aa5f6286a15c818a47344fc80964f5288bb52.tar.gz |
frontend: Allow filtering for orphaned associations
With the association count filters in place we may now also allow the
user to filter for associations that do not have a matching counterparts
(artists without a comic, for example).
Diffstat (limited to '')
-rw-r--r-- | frontend/src/lib/toolbar/FilterOrphaned.svelte | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/frontend/src/lib/toolbar/FilterOrphaned.svelte b/frontend/src/lib/toolbar/FilterOrphaned.svelte new file mode 100644 index 0000000..7e79be1 --- /dev/null +++ b/frontend/src/lib/toolbar/FilterOrphaned.svelte @@ -0,0 +1,24 @@ +<script lang="ts"> + import { page } from '$app/state'; + import { BasicFilterContext, NamespaceFilterContext } from '$lib/Filter.svelte'; + import { accelerator } from '$lib/Shortcuts'; + import Orphan from '$lib/icons/Orphan.svelte'; + + let { filter }: { filter: BasicFilterContext | NamespaceFilterContext } = $props(); + let orphaned = $derived(filter.include.orphan.value); + + const toggle = () => { + filter.include.orphan.value = !orphaned; + filter.apply(page.url.searchParams); + }; +</script> + +<button + class:toggled={orphaned} + class="btn-slate" + title="Filter orphaned" + onclick={toggle} + use:accelerator={'r'} +> + <Orphan {orphaned} /> +</button> |