|
|
|
|
@ -7,6 +7,8 @@
@@ -7,6 +7,8 @@
|
|
|
|
|
import { t } from '../../translations.svelte.js'; |
|
|
|
|
|
|
|
|
|
let filter = $state(null); |
|
|
|
|
let lower_filter = $derived(filter.toLowerCase()); |
|
|
|
|
let inverted_filter = $state(false); |
|
|
|
|
let projects = $state({}); |
|
|
|
|
let router = useTinyRouter(); |
|
|
|
|
let tasks = $state(null); |
|
|
|
|
@ -46,7 +48,16 @@
@@ -46,7 +48,16 @@
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
function filterApplies(task){ |
|
|
|
|
return true; |
|
|
|
|
if (!filter) return !inverted_filter; |
|
|
|
|
if (task.name.toLowerCase().includes(lower_filter)) return !inverted_filter; |
|
|
|
|
if (task.description.source.toLowerCase().includes(lower_filter)) return !inverted_filter; |
|
|
|
|
if (projects[task.project_id].name.toLowerCase().includes(lower_filter)) return !inverted_filter; |
|
|
|
|
if (task.parent_task_id){ |
|
|
|
|
const parent = map[task.parent_task_id]; |
|
|
|
|
if (parent && parent.name.toLowerCase().includes(lower_filter)) return !inverted_filter; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
return inverted_filter; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
function go(module, id){ |
|
|
|
|
@ -112,6 +123,12 @@
@@ -112,6 +123,12 @@
|
|
|
|
|
<label> |
|
|
|
|
{t('filter')}: <input type="text" bind:value={filter} > |
|
|
|
|
</label> |
|
|
|
|
{#if filter} |
|
|
|
|
<label> |
|
|
|
|
<input type="checkbox" bind:checked={inverted_filter} /> |
|
|
|
|
{t('invert_filter')} |
|
|
|
|
</label> |
|
|
|
|
{/if} |
|
|
|
|
</div> |
|
|
|
|
{#if tasks} |
|
|
|
|
<table> |
|
|
|
|
@ -148,7 +165,7 @@
@@ -148,7 +165,7 @@
|
|
|
|
|
<td> |
|
|
|
|
<button class="symbol" onclick={() => edit(task.id)} title={t('edit')} ></button> |
|
|
|
|
<button class="symbol" onclick={() => postpone(idx)} title={t('postpone')} ></button> |
|
|
|
|
<button class="symbol" onclick={() => open(idx)} title={t('open')}></button> |
|
|
|
|
<button class="symbol" onclick={() => open(idx)} title={t('state_open')}></button> |
|
|
|
|
<button class="symbol" onclick={() => start(idx)} title={t('start')} ></button> |
|
|
|
|
<button class="symbol" onclick={() => complete(idx)} title={t('complete')} ></button> |
|
|
|
|
<button class="symbol" onclick={() => abort(idx)} title={t('abort')} ></button> |
|
|
|
|
|