diff --git a/frontend/views/buildings/form.html b/frontend/views/buildings/form.html index aaf273e..03fa00b 100644 --- a/frontend/views/buildings/form.html +++ b/frontend/views/buildings/form.html @@ -8,30 +8,23 @@
- -
+ +
- -

+

- {% if building %}Editar Edificio: {{ building.name }}{% else %}Nuevo Edificio{% endif %} + {% if building %} + Editar Edificio: {{ building.name }} + {% else %} + Nuevo Edificio / Sede + {% endif %}

-

Configura los datos de la sede, gestiona sus plantas físicas y administra sus aulas asociadas.

+

Gestión de sede institucional, plantas físicas y distribución de aulas asociadas.

- +
@@ -95,31 +88,28 @@ {% if form.floors.errors %}
{{ form.floors.errors[0] }}
{% endif %} - Cantidad de niveles estructurales (0 para Campus Virtual) + Niveles estructurales (0 para Campus Virtual)
- + {% if not building %} +
-
- Configurador Rápido de Plantas y Niveles +
+ Presets Rápidos de Estructura:
- + - +
-
- -
- - Puedes usar los botones de acceso rápido para ajustar las plantas del edificio. Cada nivel admitirá creación y vinculación de aulas específicas. - +
+ {% endif %}
{{ form.description.label(class="form-label fw-semibold") }} @@ -148,7 +138,7 @@
- + {% if building %}
@@ -156,7 +146,7 @@
Plantas Físicas y Distribución de Aulas
- Gestiona los pisos del edificio, visualiza sus aulas asignadas o crea nuevos espacios por nivel + Espacios físicos asignados a cada planta del edificio
@@ -166,7 +156,7 @@ {{ classrooms|length }} Aulas - {{ total_physical_capacity }} Plazas Físicas + {{ total_physical_capacity }} Plazas {% if not building.is_virtual %} @@ -178,7 +168,6 @@
{% if building.is_virtual %} -
@@ -210,15 +199,15 @@ {% endif %}
{{ f.floor_name }} - Código: {{ f.floor_code }} + Nivel {{ f.floor_code }}
- + {{ f.classrooms|length }} aulas - - {{ f.total_capacity }} pers. cap. + + {{ f.total_capacity }} plazas 0 %}
- + - - - - + + + + {% for c in f.classrooms %} - - - -
Aula / EspacioCapacidadEstadoAccionesAula / EspacioCapacidadEstadoAcciones
- - {{ c.code_display or c.code or c.room_number }} + + + {{ c.code_display or c.code or c.room_number }} {% if c.description %} {{ c.description }} {% endif %} + {{ c.capacity }} alumnos + {% if c.is_active %} Activa @@ -268,7 +257,7 @@ {% endif %} +
-
- +
+
Previsualización de Niveles Físicos

Ajusta el número de plantas arriba para previsualizar los niveles que compondrán este edificio. Al guardar la sede, podrás incorporar aulas directamente en cada una de sus plantas. @@ -355,16 +344,13 @@ document.addEventListener('DOMContentLoaded', function() { } function renderLevelChips(val) { - if (!floorLevelChips) return; - floorLevelChips.innerHTML = ''; const count = parseInt(val, 10) || 0; if (count === 0 || isVirtualTarget()) { if (floorModeBadge) floorModeBadge.textContent = 'Campus Virtual'; - const chip = document.createElement('span'); - chip.className = 'badge bg-info-subtle text-info border border-info-subtle px-2 py-1'; - chip.innerHTML = 'Campus Virtual (Nivel Digital)'; - floorLevelChips.appendChild(chip); + if (floorLevelChips) { + floorLevelChips.innerHTML = 'Campus Virtual (Nivel Digital)'; + } if (newBuildingPreview) { newBuildingPreview.innerHTML = 'Campus Virtual (100% Remoto)'; } @@ -374,26 +360,28 @@ document.addEventListener('DOMContentLoaded', function() { if (floorModeBadge) floorModeBadge.textContent = 'Presencial (' + count + ' pisos)'; const levels = []; - // Standard levels levels.push({ code: 'PB', name: 'Planta Baja (PB)' }); for (let i = 1; i < count; i++) { levels.push({ code: String(i), name: 'Piso ' + i }); } - levels.forEach(function(lvl) { - const chip = document.createElement('span'); - chip.className = 'badge bg-primary-subtle text-primary border border-primary-subtle px-2 py-1'; - chip.innerHTML = '' + lvl.name; - floorLevelChips.appendChild(chip); - }); + if (floorLevelChips) { + floorLevelChips.innerHTML = ''; + levels.forEach(function(lvl) { + const chip = document.createElement('span'); + chip.className = 'badge bg-primary-subtle text-primary border border-primary-subtle px-2 py-1'; + chip.innerHTML = '' + lvl.name; + floorLevelChips.appendChild(chip); + }); + } if (newBuildingPreview) { newBuildingPreview.innerHTML = ''; levels.forEach(function(lvl) { const bChip = document.createElement('div'); - bChip.className = 'p-2 rounded bg-body border text-center'; + bChip.className = 'p-2 rounded bg-body border text-center shadow-sm'; bChip.style.minWidth = '110px'; - bChip.innerHTML = '' + lvl.name + 'Nivel ' + lvl.code + ''; + bChip.innerHTML = '' + lvl.name + 'Nivel ' + lvl.code + ''; newBuildingPreview.appendChild(bChip); }); } @@ -422,7 +410,6 @@ document.addEventListener('DOMContentLoaded', function() { }); } - // Presets const pPB = document.getElementById('presetPB'); const pPB1 = document.getElementById('presetPBplus1'); const pPB3 = document.getElementById('presetPBplus3'); @@ -433,7 +420,6 @@ document.addEventListener('DOMContentLoaded', function() { if (pPB3) pPB3.addEventListener('click', function() { floorsInput.value = 4; renderLevelChips(4); }); if (pVirt) pVirt.addEventListener('click', function() { floorsInput.value = 0; renderLevelChips(0); }); - // Initial render renderLevelChips(floorsInput.value); } diff --git a/frontend/views/buildings/view.html b/frontend/views/buildings/view.html index 88634f8..c6bbcd9 100644 --- a/frontend/views/buildings/view.html +++ b/frontend/views/buildings/view.html @@ -4,17 +4,11 @@ {% block content %}