Let participants edit their scale comment while voting is open
Participants can fix typos in, add or remove their own comment until the voting closes. The rating itself stays unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
bd488e0b81
commit
d518b7a37e
6 files changed
+244
-20
No files matched your search
@@ -8,6 +8,7 @@
|
||||
* @var \App\Model\Entity\Slide|null $slide
|
||||
* @var array<string, mixed> $state
|
||||
* @var string $participantHash Seed for the shuffled items of ordering slides
|
||||
* @var string|null $ownComment Own comment on a scale slide (editable while voting is open)
|
||||
* @var int $pollIntervalMs
|
||||
*/
|
||||
$this->assign('title', $poll->title);
|
||||
@@ -217,6 +218,23 @@ $countdown = function (?int $remaining): string {
|
||||
<?= $this->Form->end() ?>
|
||||
<?php elseif ($state['hasResponded']) : ?>
|
||||
<p class="done">✓ <?= __('Deine Antwort ist angekommen.') ?></p>
|
||||
<?php if ($slide->type === 'scale' && $slide->hasComments() && $slide->isVotingOpen()) : ?>
|
||||
<?php if ($ownComment !== null) : ?>
|
||||
<p class="own-comment__label"><?= __('Dein Kommentar:') ?></p>
|
||||
<blockquote class="own-comment"><?= nl2br(h($ownComment)) ?></blockquote>
|
||||
<?php endif; ?>
|
||||
<details class="own-comment__edit">
|
||||
<summary><?= $ownComment !== null ? __('Kommentar bearbeiten') : __('Kommentar hinzufügen') ?></summary>
|
||||
<?= $this->Form->create(null, ['url' => ['_name' => 'participate:comment', 'code' => $poll->join_code], 'class' => 'vote-form']) ?>
|
||||
<?= $this->Form->hidden('slide_id', ['value' => $slide->id]) ?>
|
||||
<label class="scale-comment" for="scale-comment"><?= __('Kommentar') ?></label>
|
||||
<textarea id="scale-comment" name="comment" rows="3" maxlength="500"
|
||||
aria-describedby="comment-edit-hint"><?= h((string)$ownComment) ?></textarea>
|
||||
<p class="hint" id="comment-edit-hint"><?= __('Möglich, solange die Abstimmung läuft. Ein leeres Feld entfernt deinen Kommentar, deine Bewertung bleibt.') ?></p>
|
||||
<?= $this->Form->button(__('Kommentar speichern'), ['class' => 'button button--primary button--block']) ?>
|
||||
<?= $this->Form->end() ?>
|
||||
</details>
|
||||
<?php endif; ?>
|
||||
<?php elseif (!$slide->is_voting_open) : ?>
|
||||
<p class="muted"><?= __('Die Abstimmung zu dieser Frage ist geschlossen.') ?></p>
|
||||
<?php else : ?>
|
||||
|
||||
Reference in new issue
Block a user