Custom form configuration #268
2 changed files with 9 additions and 9 deletions
|
|
@ -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"
|
||||||
|
|
|
||||||
|
|
@ -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';
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue