Browse Source

show only target number on todo tasks.

main
Gisle Aune 4 years ago
parent
commit
53bb683c9b
  1. 25
      svelte-ui/src/components/TaskIcon.svelte

25
svelte-ui/src/components/TaskIcon.svelte

@ -8,6 +8,7 @@ import type { IconName } from "../external/icons";
export let iconName: IconName; export let iconName: IconName;
let showNumbersAnyway; let showNumbersAnyway;
let inactive;
$: { $: {
switch (task.statusTag) { switch (task.statusTag) {
@ -20,16 +21,23 @@ import type { IconName } from "../external/icons";
} }
$: showNumbersAnyway = ["to do", "on hold"].includes(task.statusTag) && task.itemAmount > 1; $: showNumbersAnyway = ["to do", "on hold"].includes(task.statusTag) && task.itemAmount > 1;
$: inactive = !task.active || showNumbersAnyway;
</script> </script>
<div class="icon sccsi" class:inactive={!task.active && !showNumbersAnyway}>
{#if !task.active && !showNumbersAnyway}
<span class="on"><Icon block name={iconName} /></span>
<div class="icon sccsi" class:targetonly={showNumbersAnyway} class:inactive={inactive}>
{#if !task.active || showNumbersAnyway}
<span class="on">
{#if showNumbersAnyway}
{task.itemAmount}
{:else}
<Icon block name={iconName} />
{/if}
</span>
<span class="off"> <span class="off">
{task.completedAmount}&nbsp;/&nbsp;{task.itemAmount} {task.completedAmount}&nbsp;/&nbsp;{task.itemAmount}
</span> </span>
{:else} {:else}
{task.completedAmount}&nbsp;/&nbsp;{task.itemAmount}
{task.completedAmount}&nbsp;&nbsp;{task.itemAmount}
{/if} {/if}
</div> </div>
@ -51,6 +59,15 @@ import type { IconName } from "../external/icons";
background: #484; background: #484;
color: #78ff78; 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 { div.icon.inactive span.off {
display: none; display: none;
} }

Loading…
Cancel
Save