From 53bb683c9b13e7dfcf0ab31ca29c4e24809b01df Mon Sep 17 00:00:00 2001 From: Gisle Aune Date: Sun, 4 Apr 2021 13:20:08 +0200 Subject: [PATCH] show only target number on todo tasks. --- svelte-ui/src/components/TaskIcon.svelte | 25 ++++++++++++++++++++---- 1 file changed, 21 insertions(+), 4 deletions(-) diff --git a/svelte-ui/src/components/TaskIcon.svelte b/svelte-ui/src/components/TaskIcon.svelte index 2cd2f17..43a146c 100644 --- a/svelte-ui/src/components/TaskIcon.svelte +++ b/svelte-ui/src/components/TaskIcon.svelte @@ -8,6 +8,7 @@ import type { IconName } from "../external/icons"; export let iconName: IconName; let showNumbersAnyway; + let inactive; $: { switch (task.statusTag) { @@ -20,16 +21,23 @@ import type { IconName } from "../external/icons"; } $: showNumbersAnyway = ["to do", "on hold"].includes(task.statusTag) && task.itemAmount > 1; + $: inactive = !task.active || showNumbersAnyway; -
- {#if !task.active && !showNumbersAnyway} - +
+ {#if !task.active || showNumbersAnyway} + + {#if showNumbersAnyway} + {task.itemAmount} + {:else} + + {/if} + {task.completedAmount} / {task.itemAmount} {:else} - {task.completedAmount} / {task.itemAmount} + {task.completedAmount}  {task.itemAmount} {/if}
@@ -51,6 +59,15 @@ import type { IconName } from "../external/icons"; background: #484; color: #78ff78; } + div.icon.targetonly { + min-width: 1.5ch; + text-align: center; + padding-top: 0.205em; + padding-bottom: 0.225em; + } + div.icon.targetonly span.on { + font-weight: 800; + } div.icon.inactive span.off { display: none; }