Browse Source

preparing for task list filtering

Signed-off-by: Stephan Richter <s.richter@srsoftware.de>
feature/filter_task_list
Stephan Richter 6 days ago
parent
commit
65d398c668
  1. 12
      frontend/src/routes/task/Index.svelte

12
frontend/src/routes/task/Index.svelte

@ -6,6 +6,7 @@
import { error, yikes } from '../../warn.svelte'; import { error, yikes } from '../../warn.svelte';
import { t } from '../../translations.svelte.js'; import { t } from '../../translations.svelte.js';
let filter = $state(null);
let projects = $state({}); let projects = $state({});
let router = useTinyRouter(); let router = useTinyRouter();
let tasks = $state(null); let tasks = $state(null);
@ -44,6 +45,10 @@
router.navigate(`/task/${tid}/edit`); router.navigate(`/task/${tid}/edit`);
} }
function filterApplies(task){
return true;
}
function go(module, id){ function go(module, id){
router.navigate(`/${module}/${id}/view`); router.navigate(`/${module}/${id}/view`);
} }
@ -103,6 +108,11 @@
<fieldset> <fieldset>
<legend>{loading ? t('loading_object',{object:t('task_list')}) : t('task_list')}</legend> <legend>{loading ? t('loading_object',{object:t('task_list')}) : t('task_list')}</legend>
<div class="filter">
<label>
{t('filter')}: <input type="text" bind:value={filter} >
</label>
</div>
{#if tasks} {#if tasks}
<table> <table>
<thead> <thead>
@ -117,7 +127,7 @@
</thead> </thead>
<tbody> <tbody>
{#each tasks as task,idx} {#each tasks as task,idx}
{#if task.status > 10 && task.status < 60 && !task.no_index && projects[task.project_id]?.status < 60 && !hidden[task.id]} {#if task.status > 10 && task.status < 60 && !task.no_index && projects[task.project_id]?.status < 60 && !hidden[task.id] && filterApplies(task)}
<tr> <tr>
<td onclick={() => go('task',task.id)}>{task.name}</td> <td onclick={() => go('task',task.id)}>{task.name}</td>
<td> <td>

Loading…
Cancel
Save