|
|
@ -10,18 +10,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
{% for form in formset %}
|
|
|
|
{% for form in formset %}
|
|
|
|
<div class="row">
|
|
|
|
<div class="row">
|
|
|
|
{{ form.name }}
|
|
|
|
{% for field in form %}
|
|
|
|
|
|
|
|
{{ field }}
|
|
|
|
<div class="rating-container">
|
|
|
|
|
|
|
|
<div class="rating" style="--num-choices: {{ form.rating | length }}">
|
|
|
|
|
|
|
|
{% for radio in form.rating %}
|
|
|
|
|
|
|
|
{{ radio.tag }}
|
|
|
|
|
|
|
|
<label class="rating-point" for="{{ radio.id_for_label }}"></label>
|
|
|
|
|
|
|
|
{% endfor %}
|
|
|
|
{% endfor %}
|
|
|
|
</div>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<button class="reset" type="button">Zurücksetzen</button>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
{% endfor %}
|
|
|
|
{% endfor %}
|
|
|
|
|
|
|
|
|
|
|
@ -76,10 +67,10 @@ const registerEvents = row => {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
row.querySelector('.reset').addEventListener('click', event => {
|
|
|
|
row.querySelector('input[name$=rating]').addEventListener('keydown', event => {
|
|
|
|
event.target.parentElement.querySelectorAll('.rating-container > .rating > input').forEach(input => {
|
|
|
|
if (event.key === 'Enter') {
|
|
|
|
input.checked = false;
|
|
|
|
event.preventDefault();
|
|
|
|
});
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
|
};
|
|
|
|
};
|
|
|
|
document.querySelectorAll('.row').forEach(registerEvents);
|
|
|
|
document.querySelectorAll('.row').forEach(registerEvents);
|
|
|
@ -110,9 +101,7 @@ addBtn.addEventListener('click', () => {
|
|
|
|
input.dataset.bestMatch = '';
|
|
|
|
input.dataset.bestMatch = '';
|
|
|
|
input.dataset.value = '';
|
|
|
|
input.dataset.value = '';
|
|
|
|
|
|
|
|
|
|
|
|
row.querySelectorAll('.rating-container > .rating > input').forEach(input => {
|
|
|
|
row.querySelector('input[name$=rating]').value = undefined;
|
|
|
|
input.checked = false;
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
registerEvents(row);
|
|
|
|
registerEvents(row);
|
|
|
|
|
|
|
|
|
|
|
|