Enhance settings page; add room management functionality with combo box integration and update rendering logic for improved usability

This commit is contained in:
Yaro Kasear 2025-06-18 15:36:34 -05:00
parent ad413c3f1b
commit ec08dd8ef1
4 changed files with 56 additions and 13 deletions

View file

@ -1,6 +1,6 @@
{% import "fragments/_icon_fragment.html" as icons %}
{% macro render_combobox(id, options, label=none, placeholder=none) %}
{% macro render_combobox(id, options, label=none, placeholder=none, onAdd=none, onRemove=none, onEdit=none) %}
{% if label %}
<label for="{{ id }}-input" class="form-label">{{ label }}</label>
{% endif %}
@ -23,7 +23,11 @@
<script>
document.addEventListener('DOMContentLoaded', () => {
ComboBoxWidget.initComboBox("{{ id }}");
ComboBoxWidget.initComboBox("{{ id }}", {
{% if onAdd %}onAdd: {{ onAdd }},{% endif %}
{% if onRemove %}onRemove: {{ onRemove }},{% endif %}
{% if onEdit %}onEdit: {{ onEdit }}{% endif %}
});
});
</script>
{% endmacro %}
{% endmacro %}