Enhance app configuration and prettify HTML responses; update requirements and fix button identifiers in settings template
This commit is contained in:
parent
7c15754cab
commit
4c36621eba
4 changed files with 28 additions and 8 deletions
|
@ -6,7 +6,7 @@
|
|||
<form id="settingsForm">
|
||||
{{ breadcrumbs.breadcrumb_header(
|
||||
title=title,
|
||||
submit_button=True
|
||||
save_button=True
|
||||
) }}
|
||||
|
||||
<div class="container">
|
||||
|
@ -131,7 +131,7 @@
|
|||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-danger" data-bs-dismiss="modal"
|
||||
id="roomEditorCancelButton">Cancel</button>
|
||||
<button type="button" class="btn btn-primary" id="roomEditorSaveButton">Save</button>
|
||||
<button type="button" class="btn btn-primary" id="editorSaveButton">Save</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -196,9 +196,9 @@
|
|||
};
|
||||
}
|
||||
|
||||
document.addEventListener('DOMContentLoaded', () => {
|
||||
const modal = document.getElementById('roomEditor');
|
||||
const saveButton = document.getElementById('roomEditorSaveButton');
|
||||
const saveButton = document.getElementById('saveButton')
|
||||
const editorSaveButton = document.getElementById('editorSaveButton');
|
||||
const cancelButton = document.getElementById('roomEditorCancelButton');
|
||||
const form = document.getElementById('settingsForm');
|
||||
|
||||
|
@ -234,8 +234,9 @@
|
|||
});
|
||||
});
|
||||
|
||||
form.addEventListener('submit', async (event) => {
|
||||
saveButton.addEventListener('click', async (event) => {
|
||||
event.preventDefault();
|
||||
console.log("Test")
|
||||
const state = buildFormState();
|
||||
|
||||
if (!isSerializable(state)) {
|
||||
|
@ -273,7 +274,7 @@
|
|||
}
|
||||
});
|
||||
|
||||
saveButton.addEventListener('click', () => {
|
||||
editorSaveButton.addEventListener('click', () => {
|
||||
const name = document.getElementById('roomName').value.trim();
|
||||
const sectionVal = document.getElementById('roomSection').value;
|
||||
const funcVal = document.getElementById('roomFunction').value;
|
||||
|
@ -309,5 +310,4 @@
|
|||
cancelButton.addEventListener('click', () => {
|
||||
bootstrap.Modal.getInstance(modal).hide();
|
||||
});
|
||||
});
|
||||
{% endblock %}
|
Loading…
Add table
Add a link
Reference in a new issue