This commit is contained in:
parent
5140eafc51
commit
8d87105609
@ -8,13 +8,29 @@
|
||||
|
||||
let surveyP = null;
|
||||
$: surveyP = getSharedSurvey(data.idsurvey, data.secret);
|
||||
|
||||
let max_responses = 0;
|
||||
|
||||
function calc_responses(responses) {
|
||||
const len = responses.length;
|
||||
if (max_responses < len) {
|
||||
max_responses = len;
|
||||
}
|
||||
|
||||
return len;
|
||||
}
|
||||
</script>
|
||||
|
||||
{#await surveyP then survey}
|
||||
<div class="d-flex align-items-center">
|
||||
<h2>
|
||||
{survey.title}
|
||||
<small class="text-muted">Réponses</small>
|
||||
<small class="text-muted">
|
||||
Réponses
|
||||
{#if max_responses > 0}
|
||||
({max_responses})
|
||||
{/if}
|
||||
</small>
|
||||
</h2>
|
||||
<SurveyBadge class="ms-2" {survey} />
|
||||
</div>
|
||||
@ -26,10 +42,17 @@
|
||||
</div>
|
||||
{:then questions}
|
||||
{#each questions as question (question.id)}
|
||||
<h3>{question.title}</h3>
|
||||
{#if question.kind == "text" || (data.exportview_list && question.kind.indexOf("list") == 0)}
|
||||
{#await question.getResponses(data.secret) then responses}
|
||||
{#each responses as response (response.id)}
|
||||
{#await question.getResponses(data.secret)}
|
||||
<h3>{question.title}</h3>
|
||||
{:then responses}
|
||||
<h3>
|
||||
{question.title}
|
||||
<small class="text-muted float-end">
|
||||
{calc_responses(responses)} réponses
|
||||
</small>
|
||||
</h3>
|
||||
{#each calc_responses(responses) as response (response.id)}
|
||||
<div class="card mb-2">
|
||||
<div class="card-body">
|
||||
<p class="card-text" style:white-space="pre-line">
|
||||
|
Reference in New Issue
Block a user