diff --git a/frontend/src/routes/Review.svelte b/frontend/src/routes/Review.svelte index 0dd5e5c..5dfa070 100644 --- a/frontend/src/routes/Review.svelte +++ b/frontend/src/routes/Review.svelte @@ -1,7 +1,28 @@ {#snippet eventRow(e: CalEvent)} -
  • + {@const KindIcon = KIND_ICONS[e.kind]} +
  • {#if selecting} {/if} - {#if e.include} - + {:else} - + {/if}
    {#if editing === e.id} @@ -144,78 +179,93 @@
  • {/snippet} -{#snippet group(title: string, list: CalEvent[], note: string)} +{#snippet group(title: string, Icon: Component, tone: string, list: CalEvent[], note: string)} {#if list.length} -

    {title} ({list.length})

    - {#if note}

    {note}

    {/if} - +
    +

    + {#if note}

    {note}

    {/if} + +
    + {/if} +{/snippet} + +{#snippet collapsed(key: 'unchanged' | 'excluded', title: string, Icon: Component, list: CalEvent[])} + {#if list.length} +
    + + {#if open[key]}
      {#each list as e (e.id)}{@render eventRow(e)}{/each}
    {/if} +
    {/if} {/snippet}
    -
    -
    - {#if scan.image_keys.length} -
    - {`Page - {#if activeBox && scan.events.find((e) => e.id === active)?.page === page} -
    - {/if} -
    - {:else} -

    The photo has been deleted.

    - {/if} +
    +
    -
    - - + - - + - +
    {#if selecting} -
    +
    -

    {selected.length} selected

    -
    - - - - - + + + + + + +
    {/if} {#if editing === 'new'} -
    -

    New event

    +
    +

    New event

    s.id === scan.source_id)?.child_ids ?? [] }} onsave={add} @@ -225,82 +275,115 @@ {/if} {#if view === 'grid'} -

    Tap a day to add an event.

    +

    Tap a day to add an event.

    {#each months as month} e.include)} {colorFor} onday={addOn} /> {/each} {:else} {#if !live.length && !scan.menu_items.length} -

    Nothing was found on this page. Add events by hand, or discard the scan.

    - {/if} - {@render group('Needs a look', needs, 'Each one says why. Tap to see where it came from on the photo.')} - {@render group('Updated', updated, 'Already on your calendar; publishing applies these changes.')} - {@render group('New', fresh, '')} - - {#if unchanged.length} - - {#if open.unchanged}
      {#each unchanged as e (e.id)}{@render eventRow(e)}{/each}
    {/if} - {/if} - {#if excluded.length} - - {#if open.excluded}
      {#each excluded as e (e.id)}{@render eventRow(e)}{/each}
    {/if} +
    Nothing was found on this page. Add events by hand, or discard the scan.
    {/if} + {@render group('Needs a look', TriangleAlert, 'warn', needs, 'Each one says why. Tap it to see where it came from on the photo.')} + {@render group('Updated', RefreshCw, 'info', updated, 'Already on your calendar; publishing applies these changes.')} + {@render group('New', Sparkles, '', fresh, '')} + {@render collapsed('unchanged', 'Unchanged', CheckCheck, unchanged)} + {@render collapsed('excluded', 'Not for this child, or unchecked', EyeOff, excluded)} {#if scan.menu_items.length} -

    Menu ({scan.menu_items.length} days{flaggedMenu ? `, ${flaggedMenu} need a look` : ''})

    -

    One food per line. Your kids pick lunch days on the Lunch screen after you publish.

    -
      - {#each scan.menu_items as m (m.id)} - {@const text = m.items.join('\n')} - - {/each} -
    +
    +

    +

    One food per line. Your kids pick lunch days on the Lunch tab after you publish.

    + +
    {/if} {/if} + +
    + {included} {included === 1 ? 'event' : 'events'}{scan.menu_items.length ? ` · ${scan.menu_items.length} menu days` : ''} + +