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

View file

@ -15,7 +15,8 @@
return;
}
toggleButton.addEventListener('click', function() {
toggleButton.addEventListener('click', function(e) {
e.preventDefault();
isExpertMode = !isExpertMode;
const activeFormInput = document.getElementById('active-form-input');
@ -23,12 +24,12 @@
if (isExpertMode) {
customFormContainer.style.display = 'none';
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';
} else {
customFormContainer.style.display = 'block';
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';
}
});