mirror of
https://github.com/MarijnDoeve/TijdVoorDeTest.git
synced 2026-07-07 16:10:15 +02:00
feat: replace fetch-based modal forms with Turbo Frames (#181)
Enable @hotwired/turbo with Drive explicitly disabled, then migrate the bo--modal-form Stimulus controller (custom fetch + X-Modal-Request pattern) to a thin bo--modal controller that lets Turbo handle HTTP and DOM swap. Adds frame templates for quiz questions and bank questions; controllers now detect Turbo-Frame header instead of X-Modal-Request.
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
<turbo-frame id="question-modal-frame">
|
||||
<div class="modal-body">
|
||||
<p class="fw-semibold mb-3">{{ question.question }}</p>
|
||||
<ul class="list-group">
|
||||
{% for answer in question.answers %}
|
||||
<li class="list-group-item d-flex justify-content-between align-items-center">
|
||||
<span{% if answer.isRightAnswer %} class="fw-semibold"{% endif %}>
|
||||
{% if answer.isRightAnswer %}<i class="bi bi-check-circle-fill text-success me-1"></i>{% endif %}
|
||||
{{ answer.text }}
|
||||
</span>
|
||||
{% if answer.candidates|length > 0 %}
|
||||
<span class="text-muted small">{{ answer.candidates|map(c => c.name)|join(', ') }}</span>
|
||||
{% endif %}
|
||||
</li>
|
||||
{% else %}
|
||||
<li class="list-group-item text-muted">{{ 'There are no answers for this question'|trans }}</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">{{ 'Close'|trans }}</button>
|
||||
</div>
|
||||
</turbo-frame>
|
||||
Reference in New Issue
Block a user