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 roomEditorModal = new bootstrap.Modal(document.getElementById('roomEditor'));
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);
const event = new CustomEvent('roomEditor:prepare', {
detail: {
id: existingOption?.value ?? '',
name: name,
sectionId: existingOption?.dataset.sectionId ?? '',
functionId: existingOption?.dataset.functionId ?? ''
}
});
document.getElementById('roomEditor').dispatchEvent(event);
roomEditorModal.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,
data_attributes={'area_id': 'section-id', 'function_id': 'function-id'}
) }}