Count submissions
Some checks are pending
continuous-integration/drone/push Build is running

This commit is contained in:
nemunaire 2022-09-16 11:14:50 +02:00
commit 73b33f9fb5
2 changed files with 36 additions and 5 deletions

View file

@ -22,6 +22,14 @@
import { getUsers } from '../../../lib/users';
export let work = null;
let usersP = null;
work.then((w) => {
usersP = getUsers(w.promo, w.group);
usersP.then((users) => { nb_users = users.length; });
});
let nb_rendus = 0;
let nb_users = 0;
</script>
{#await work then w}
@ -29,12 +37,12 @@
<h2>
<a href="works/{w.id}" class="text-muted" style="text-decoration: none">&lt;</a>
{w.title}
<small class="text-muted">Rendus {Math.trunc(nb_rendus/nb_users*100)}&nbsp;% ({nb_rendus}/{nb_users})</small>
</h2>
<SurveyBadge class="ms-2" survey={w} />
</div>
{#await getUsers(w.promo, w.group)}
{:then users}
{#await usersP then users}
<table class="w-100 mb-5">
<thead>
<tr>
@ -48,7 +56,7 @@
<tr>
<td><a href="users/{user.login}">{user.login}</a></td>
<td>
<SubmissionStatus work={w} user={user} />
<SubmissionStatus work={w} user={user} on:done={() => { nb_rendus += 1; user.show_dl_btn = true; }} />
</td>
<td>
{#await getRepositories(w.id, user.id) then repos}
@ -82,6 +90,7 @@
<a
href="/api/users/{user.id}/works/{w.id}/download"
class="btn btn-sm btn-dark"
class:disabled={!user.show_dl_btn}
title="Télécharger la tarball du rendu"
>
<i class="bi bi-download"></i>