{% extends "layout.html" %} {% block title %}{{ title }}{% endblock %} {% block content %}
{% endblock %} {% block script %} document.addEventListener('DOMContentLoaded', () => { const modal = document.getElementById('roomEditor'); const saveButton = document.getElementById('roomEditorSaveButton'); const cancelButton = document.getElementById('roomEditorCancelButton'); saveButton.addEventListener('click', () => { console.log('Save button clicked'); const name = document.getElementById('roomName').value; const section = document.getElementById('roomSection').value; const func = document.getElementById('roomFunction').value; if (name.trim()) { const newRoom = ComboBoxWidget.createOption(`${name}`, null); const selectWidget = document.getElementById('room-list'); selectWidget.appendChild(newRoom); ComboBoxWidget.sortOptions(selectWidget); bootstrap.Modal.getInstance(modal).hide(); } else { alert('Please enter a room name.'); } }); cancelButton.addEventListener('click', () => { console.log('Cancel button clicked'); bootstrap.Modal.getInstance(modal).hide(); }); }); {% endblock %}