added state buttons to task list
Signed-off-by: Stephan Richter <s.richter@srsoftware.de>
This commit is contained in:
@@ -12,6 +12,10 @@
|
||||
let error = $state(null);
|
||||
let start = 0;
|
||||
|
||||
function addSubtask(){
|
||||
router.navigate(`/task/${task.id}/add_subtask`);
|
||||
}
|
||||
|
||||
async function loadChildren(){
|
||||
const url = api('task/list');
|
||||
var data = {
|
||||
@@ -69,12 +73,23 @@
|
||||
{#if task.estimated_time}
|
||||
<span class="estimated_time">({+task.estimated_time} h)</span>
|
||||
{/if}
|
||||
{#if task.status.code < 60}
|
||||
<button class="symbol" title={t('complete')} onclick={() => patchTask({status:'COMPLETE'})}></button>
|
||||
<button class="symbol" title={t('abort')} onclick={() => patchTask({status:'CANCELLED'})} ></button>
|
||||
{:else}
|
||||
{#if task.status.name != 'PENDING'}
|
||||
<button class="symbol" title={t('do_open')} onclick={() => patchTask({status:'PENDING'})}></button>
|
||||
{/if}
|
||||
{#if task.status.name != 'OPEN'}
|
||||
<button class="symbol" title={t('do_open')} onclick={() => patchTask({status:'OPEN'})}></button>
|
||||
{/if}
|
||||
{#if task.status.name != 'STARTED'}
|
||||
<button class="symbol" title={t('started')} onclick={() => patchTask({status:'STARTED'})}></button>
|
||||
{/if}
|
||||
{#if task.status.name != 'COMPLETE'}
|
||||
<button class="symbol" title={t('complete')} onclick={() => patchTask({status:'COMPLETE'})}></button>
|
||||
{/if}
|
||||
{#if task.status.name != 'CANCELLED'}
|
||||
<button class="symbol" title={t('abort')} onclick={() => patchTask({status:'CANCELLED'})} ></button>
|
||||
{/if}
|
||||
|
||||
<button class="symbol" title={t('add_subtask')} onclick={addSubtask}></button>
|
||||
{#if error}
|
||||
<span class="error">{error}</span>
|
||||
{/if}
|
||||
|
||||
Reference in New Issue
Block a user