Location Settings
{{ combos.render_combobox(
id='section',
options=sections,
label='Sections',
placeholder='Add a new section'
) }}
{{ combos.render_combobox(
id='function',
options=functions,
label='Functions',
placeholder='Add a new function'
) }}
{% set room_editor %}
const roomEditor = new bootstrap.Modal(document.getElementById('roomEditor'));
const roomNameInput = document.getElementById('roomName');
const input = document.getElementById('room-input');
const name = input.value.trim();
const existingOption = Array.from(document.getElementById('room-list').options)
.find(opt => opt.textContent.trim() === name);
roomNameInput.value = name;
document.getElementById('roomId').value = existingOption?.value ?? ''; // this will be the ID or temp ID
if (existingOption?.dataset.sectionId)
document.getElementById('roomSection').value = existingOption.dataset.sectionId;
if (existingOption?.dataset.functionId)
document.getElementById('roomFunction').value = existingOption.dataset.functionId;
roomEditor.show();
document.getElementById('room-input').value = '';
{% endset %}
{{ combos.render_combobox(
id='room',
options=rooms,
label='Rooms',
placeholder='Add a new room',
onAdd=room_editor,
onEdit=room_editor
) }}