qa: Handle single theme review

This commit is contained in:
nemunaire 2024-09-18 11:55:13 +02:00
parent a82e3642a8
commit 0bf367bd3b

View File

@ -29,6 +29,7 @@
style="overflow-y: auto" style="overflow-y: auto"
> >
{#await themesP then themes} {#await themesP then themes}
{#if Object.keys(themes).length > 1}
<Row <Row
style={'min-width:'+15*Object.keys(themes).length + 'vw'} style={'min-width:'+15*Object.keys(themes).length + 'vw'}
> >
@ -69,5 +70,48 @@
</Col> </Col>
{/each} {/each}
</Row> </Row>
{:else}
{#each Object.keys(themes) as tname}
{#if themes[tname].exercices}
{#each themes[tname].exercices as exercice}
<Row
style={'min-width:'+15*Object.keys(themes).length + 'vw'}
>
<Col style="border-right: 1px solid lightgray">
<h3
class="text-center py-3 mb-3"
style="border-bottom: 2px solid black"
on:click={() => goto(`exercices/${exercice.exercice.id}`)}
>
{exercice.exercice.title}
</h3>
{#if exercice.reports}
{#each exercice.reports as report}
<Card
class="mb-3"
color={state2Color(report.report.state)}
style="cursor: pointer"
on:click={() => goto(`exercices/${exercice.exercice.id}/${report.report.id}`)}
>
<CardBody class="p-2">
{report.report.subject}
{#if report.comments}
<Badge
class="float-end"
>
{report.comments.length}
</Badge>
{/if}
</CardBody>
</Card>
{/each}
<hr />
{/if}
</Col>
</Row>
{/each}
{/if}
{/each}
{/if}
{/await} {/await}
</div> </div>