{#snippet foldOf(unit: Unit, p: Proposal)} go(panel, id)} onsettings={(id) => openPanel({ unitId: unit.id, proposalId: id, tab: 'settings' })} ondetails={(id) => openPanel({ unitId: unit.id, proposalId: id, tab: 'details' })} onsign={sign} /> {/snippet} {title ? `${title} · libreDecision` : 'libreDecision'} {#if doc.error} doc.load(group, slug)} /> {:else if view}

{view.doc.groupName}{t('nav.docs')}

{title}

{#if titleUnit?.inForce} {@const tp = titleUnit.inForce} onUnit(titleUnit, action)} > {#snippet fold()}{@render foldOf(titleUnit, tp)}{/snippet} {/if}

{summary}

{i18n.plural('docs.inForce', doc.inForce.length)} · {i18n.plural('docs.open', doc.open.length)} {#if view.doc.publication.state === 'done'} · {t('doc.published')}{:else if view.doc.publication.state === 'pending'} · {t('doc.publish.pending')}{/if} ·

{#if canVote}
{/if}
{#each VIEWS as v (v)} {/each}
{#each LANGS as l (l)} {/each}
{#if lang !== source}

{t('doc.lang.translation')}

{/if} {#if doc.mode !== 'inforce'}

{t(`doc.view.${doc.mode}.note`)}

{/if}
{#if doc.mode === 'inforce' || !doc.preview} {#each doc.inForceBySection as s, i (`${i}:${s.section}`)} {#each s.units as u (u.id)} {#if u.inForce} {@const p = u.inForce} onUnit(u, action)} > {#snippet fold()}{@render foldOf(u, p)}{/snippet} {/if} {/each} {#if s.order?.inForce} {@const o = s.order} {@const op = s.order.inForce} onUnit(o, action)} > {#snippet fold()}{@render foldOf(o, op)}{/snippet} {/if} {:else}

{t('doc.empty')}

{/each} {:else} {#each doc.preview as pu (pu.unitId)} {@const u = doc.unit(pu.unitId)} {@const id = pu.proposalId ?? u?.inForce?.id ?? null} {@const p = doc.proposal(id)} u && onUnit(u, action, id)} > {#snippet fold()}{#if u && p}{@render foldOf(u, p)}{/if}{/snippet} {/each} {#if doc.preview.every((x) => x.mark === 'unchanged')}

{t('doc.view.empty')}

{/if} {/if}
{#if doc.drafts.length}

{t('deep.drafts')}

{t('deep.drafts.note')}

    {#each doc.drafts as { unit, proposal } (proposal.id)}
  • {/each}
{/if}

{t('deep.title')}

{t('deep.note', { floor: view.doc.voteFloor })}

{#each ['all', 'wellrated', 'mine'] as const as f (f)} {/each}
toggleVote(p.id)} fold={foldOf} {nameOf} onsection={canVote ? (section) => openPanel({ unitId: null, proposalId: null, tab: 'basket', section }) : undefined} />
{#if panel} openPanel(p)} onclose={() => openPanel(null)} onvote={openVote} onsign={sign} /> {/if} {#if signing && view.vote.chain} basket.clear()} onclose={() => (signing = null)} /> {/if} {/if} e.key === 'Escape' && panel && !signing && openPanel(null)} />