Custom form configuration #268

Merged
tobru merged 34 commits from 165-form-configuration into main 2025-11-10 14:49:33 +00:00
2 changed files with 9 additions and 9 deletions
Showing only changes of commit 985e4b47c0 - Show all commits

View file

@ -7,12 +7,11 @@
{% csrf_token %} {% csrf_token %}
{% include "frontend/forms/errors.html" %} {% include "frontend/forms/errors.html" %}
{% if form %} {% if form %}
<div class="mb-3"> <div class="mb-3 text-end">
<button type="button" <a href="#"
class="btn btn-sm btn-outline-secondary ml-auto d-block" class="text-muted small"
id="expert-mode-toggle"> id="expert-mode-toggle"
<i class="bi bi-code-square"></i> {% translate "Show Expert Mode" %} style="text-decoration: none">{% translate "Show Expert Mode" %}</a>
</button>
</div> </div>
{% endif %} {% endif %}
<div id="custom-form-container" <div id="custom-form-container"

View file

@ -15,7 +15,8 @@
return; return;
} }
toggleButton.addEventListener('click', function() { toggleButton.addEventListener('click', function(e) {
e.preventDefault();
isExpertMode = !isExpertMode; isExpertMode = !isExpertMode;
const activeFormInput = document.getElementById('active-form-input'); const activeFormInput = document.getElementById('active-form-input');
@ -23,12 +24,12 @@
if (isExpertMode) { if (isExpertMode) {
customFormContainer.style.display = 'none'; customFormContainer.style.display = 'none';
expertFormContainer.style.display = 'block'; expertFormContainer.style.display = 'block';
toggleButton.innerHTML = '<i class="bi bi-code-square-fill"></i> Show Simplified Form'; toggleButton.textContent = 'Show Simplified Form';
if (activeFormInput) activeFormInput.value = 'expert'; if (activeFormInput) activeFormInput.value = 'expert';
} else { } else {
customFormContainer.style.display = 'block'; customFormContainer.style.display = 'block';
expertFormContainer.style.display = 'none'; expertFormContainer.style.display = 'none';
toggleButton.innerHTML = '<i class="bi bi-code-square"></i> Show Expert Mode'; toggleButton.textContent = 'Show Expert Mode';
if (activeFormInput) activeFormInput.value = 'custom'; if (activeFormInput) activeFormInput.value = 'custom';
} }
}); });