fix(ui): improve subjects modals and table layout preventing element clipping (v3.8.22)
This commit is contained in:
@@ -11,6 +11,14 @@ El formato está basado en [Keep a Changelog](https://keepachangelog.com/es-ES/1
|
||||
- **Sincronización Continua Moodle (Fase 6):** Automatización de workers persistentes en background para el procesamiento continuo de la cola de Web Services Moodle 4.1.
|
||||
- **Pruebas de Carga y Hardening (Fase 6):** Pruebas de estrés de concurrencia y validación final de producción.
|
||||
|
||||
## [3.8.22] - 2026-10-26
|
||||
### Improved & Fixed (UI / UX)
|
||||
- **Gestión de Asignaturas: Optimización de Modales y Tabla Antidesbordamiento (`admin/subjects_list`)**:
|
||||
- Transformados los modales de alta (`#modalAddSubject`) y edición (`#modalEditSubject`) a un diseño amplio en 2 columnas (`modal-lg modal-dialog-centered modal-dialog-scrollable`), eliminando el amontonamiento vertical y garantizando que los botones de confirmación y cancelación nunca se corten en pantallas pequeñas o laptops.
|
||||
- Columna izquierda dedicada a información académica (Código, Créditos, Nombre, Departamento, Descripción y switch de estado) con campos espaciosos sin truncamiento.
|
||||
- Columna derecha con selector de carreras enriquecido: buscador con icono, acciones masivas ("Todas" / "Ninguna"), contenedor con scroll suave (`max-height: 250px`), tarjetas con hover interactivo y selección al hacer click en toda la fila.
|
||||
- Tabla de asignaturas optimizada con anchos mínimos por columna (`min-width`) y ajuste fluido de texto (`text-wrap`), previniendo que los nombres de materias, carreras o departamentos se corten prematuramente.
|
||||
|
||||
## [3.8.21] - 2026-10-26
|
||||
### Added & Improved
|
||||
- **Gestión de Asignaturas: Asociación a Múltiples Carreras (`admin/subjects_list`)**:
|
||||
|
||||
@@ -9,18 +9,15 @@ Memoria del proyecto entre sesiones para la rama `dev`.
|
||||
- Libro de Calificaciones (*Gradebook*) con actas de regularidad inmutables.
|
||||
- Autenticación híbrida (Google OAuth 2.0, Moodle SSO, Local) y Modo Impersonación.
|
||||
- Reinicialización segura del sistema con contraseña de Administrador.
|
||||
- **Sprint Activo: Asociación de Asignaturas a Múltiples Carreras y Enriquecimiento Académico — v3.8.21**:
|
||||
- **Asociación Multicarrera de Asignaturas (`admin/subjects_list`)**:
|
||||
- Reemplazado el selector simple de carrera por un componente interactivo de selección múltiple con buscador en tiempo real, botones masivos "Todas"/"Ninguna", badges de código y contador dinámico ("X seleccionadas").
|
||||
- Sincronización en modales `modalAddSubject` y `modalEditSubject` vía JavaScript nativo pre-poblando checkboxes a partir de `data-career-ids`.
|
||||
- Adaptado el Frontend BFF (`admin.js`) para capturar arrays o valores únicos de `career_ids` y despacharlos al backend.
|
||||
- Sincronización robusta en Backend FastAPI (`POST /subjects` y `PUT /subjects/{id}`), actualizando `subject.careers` (Many-to-Many `subject_careers`) y manteniendo `career_id` principal como fallback relacional.
|
||||
- **Comisiones, Roles y Calificaciones (Consolidado de v3.8.20)**:
|
||||
- Nombre de materia y badges de carreras heredadas en `admin/commissions_list`.
|
||||
- Scoping estricto para Docentes y Alumnos (cero fallbacks mock).
|
||||
- Gestión de hitos y actas en Gradebook.
|
||||
- **QA & Seguridad**: 80 tests aprobados en `pytest` (100%), 0 vulnerabilidades en auditoría de seguridad (Bandit, pip-audit, njsscan, npm audit).
|
||||
- **Versión Consolidada**: `v3.8.21`.
|
||||
- **Sprint Activo: Optimización UI/UX en Asignaturas y Modales Antidesbordamiento — v3.8.22**:
|
||||
- **Rediseño UI/UX de Asignaturas (`admin/subjects_list`)**:
|
||||
- Modales `#modalAddSubject` y `#modalEditSubject` transformados a formato de 2 columnas (`modal-lg modal-dialog-centered modal-dialog-scrollable`).
|
||||
- Eliminado el amontonamiento vertical; footer fijo con botones "Guardar Cambios" y "Cancelar" siempre visibles e inaccesibles al corte por altura de pantalla.
|
||||
- Columna izquierda con formulario académico completo (Código, Créditos, Nombre, Departamento, Descripción y switch de estado activo).
|
||||
- Columna derecha con selector de carreras enriquecido (filtro en vivo, "Todas"/"Ninguna", scroll suave y tarjetas interactivas).
|
||||
- Tabla con anchos mínimos por columna (`min-width`) y `text-wrap` para evitar truncamientos y desbordamientos.
|
||||
- **QA & Seguridad**: 80 tests aprobados en `pytest` (100%), 0 vulnerabilidades en auditoría de seguridad.
|
||||
- **Versión Consolidada**: `v3.8.22`.
|
||||
|
||||
## Decisiones (y por qué)
|
||||
- **Flujo Secuencial de Bedelía (9 Pasos)**: Estandarizar la carga operativa en: 1) Sede -> 2) Aula -> 3) Ciclo Lectivo -> 4) Carrera -> 5) Materia (vinculada a Carrera) -> 6) Comisión (asociada a Materia, Carrera y Ciclo) -> 7) Profesores -> 8) Alumnos -> 9) Reserva de Espacio. Esto asegura consistencia e integridad relacional.
|
||||
|
||||
@@ -7,7 +7,7 @@ from typing import Any
|
||||
from database import db, get_db, engine, SessionLocal, session
|
||||
from config.config import Config
|
||||
|
||||
__version__ = "3.8.21"
|
||||
__version__ = "3.8.22"
|
||||
|
||||
class DummyContext:
|
||||
def __enter__(self):
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@ from setuptools import setup, find_packages
|
||||
|
||||
setup(
|
||||
name="edu-space-admin",
|
||||
version="3.8.21",
|
||||
version="3.8.22",
|
||||
description="Administrative interface for Edu-Space Classroom Management System (FastAPI ASGI Core)",
|
||||
author="Edu-Space Development Team",
|
||||
author_email="admin@edu-space.com",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "frontend",
|
||||
"version": "3.8.21",
|
||||
"version": "3.8.22",
|
||||
"description": "",
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
|
||||
+3
-3
@@ -86,9 +86,9 @@ const env = nunjucks.configure(path.join(__dirname, '../views'), {
|
||||
});
|
||||
|
||||
// Versiones institucionales del sistema
|
||||
const APP_VERSION = '3.8.21';
|
||||
const FRONTEND_VERSION = '3.8.21';
|
||||
const BACKEND_VERSION = '3.8.21';
|
||||
const APP_VERSION = '3.8.22';
|
||||
const FRONTEND_VERSION = '3.8.22';
|
||||
const BACKEND_VERSION = '3.8.22';
|
||||
|
||||
env.addGlobal('app_version', APP_VERSION);
|
||||
env.addGlobal('frontend_version', FRONTEND_VERSION);
|
||||
|
||||
@@ -3,6 +3,33 @@
|
||||
{% block title %}Gestión de Asignaturas - Edu-Space Admin{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<style>
|
||||
.hover-item {
|
||||
transition: all 0.15s ease-in-out;
|
||||
}
|
||||
.hover-item:hover {
|
||||
background-color: var(--bs-primary-bg-subtle, rgba(13, 110, 253, 0.08)) !important;
|
||||
border-color: var(--bs-primary-border-subtle, #3b82f6) !important;
|
||||
}
|
||||
.hover-item:has(.career-checkbox:checked) {
|
||||
background-color: rgba(13, 110, 253, 0.12) !important;
|
||||
border-color: var(--bs-primary) !important;
|
||||
}
|
||||
.cursor-pointer {
|
||||
cursor: pointer;
|
||||
}
|
||||
.fs-xs {
|
||||
font-size: 0.78rem;
|
||||
}
|
||||
@media (min-width: 768px) {
|
||||
.border-end-md {
|
||||
border-right: 1px solid var(--bs-border-color) !important;
|
||||
}
|
||||
}
|
||||
.modal-dialog-scrollable .modal-body {
|
||||
max-height: calc(100vh - 210px);
|
||||
}
|
||||
</style>
|
||||
<div class="container-fluid pt-5 mt-4">
|
||||
<!-- Header -->
|
||||
<div class="d-flex flex-column flex-md-row justify-content-between align-items-md-center gap-3 mb-4">
|
||||
@@ -123,15 +150,15 @@
|
||||
<table class="table table-hover align-middle mb-0">
|
||||
<thead class="bg-body-tertiary">
|
||||
<tr>
|
||||
<th>Código</th>
|
||||
<th>Nombre de la Asignatura</th>
|
||||
<th>Carrera</th>
|
||||
<th>Departamento</th>
|
||||
<th>Créditos</th>
|
||||
<th>Comisiones</th>
|
||||
<th>Estado</th>
|
||||
<th style="min-width: 105px;">Código</th>
|
||||
<th style="min-width: 250px;">Nombre de la Asignatura</th>
|
||||
<th style="min-width: 220px;">Carrera(s) Vinculada(s)</th>
|
||||
<th style="min-width: 180px;">Departamento</th>
|
||||
<th style="min-width: 85px;" class="text-center">Créditos</th>
|
||||
<th style="min-width: 100px;" class="text-center">Comisiones</th>
|
||||
<th style="min-width: 90px;" class="text-center">Estado</th>
|
||||
{% if can_edit %}
|
||||
<th class="text-end">Acciones</th>
|
||||
<th class="text-end" style="min-width: 110px;">Acciones</th>
|
||||
{% endif %}
|
||||
</tr>
|
||||
</thead>
|
||||
@@ -142,9 +169,9 @@
|
||||
<span class="badge font-monospace bg-primary-subtle text-primary border">{{ s.code }}</span>
|
||||
</td>
|
||||
<td>
|
||||
<span class="fw-bold text-body">{{ s.name }}</span>
|
||||
<span class="fw-bold text-body d-block">{{ s.name }}</span>
|
||||
{% if s.description %}
|
||||
<small class="text-muted d-block text-truncate" style="max-width: 300px;">{{ s.description }}</small>
|
||||
<small class="text-muted d-block text-wrap" style="max-width: 380px;">{{ s.description }}</small>
|
||||
{% endif %}
|
||||
</td>
|
||||
<td>
|
||||
@@ -167,15 +194,15 @@
|
||||
<td>
|
||||
<span class="small text-muted">{{ s.department or '-' }}</span>
|
||||
</td>
|
||||
<td>
|
||||
<td class="text-center">
|
||||
<span class="badge bg-light text-dark border">{{ s.credits }} cr.</span>
|
||||
</td>
|
||||
<td>
|
||||
<td class="text-center">
|
||||
<span class="badge bg-info-subtle text-info border">
|
||||
<i class="bi bi-diagram-3 me-1"></i>{{ s.commissions|length if s.commissions else 0 }}
|
||||
</span>
|
||||
</td>
|
||||
<td>
|
||||
<td class="text-center">
|
||||
<span class="badge rounded-pill {% if s.is_active %}bg-success-subtle text-success border border-success-subtle{% else %}bg-secondary-subtle text-secondary border{% endif %}">
|
||||
{% if s.is_active %}Activa{% else %}Inactiva{% endif %}
|
||||
</span>
|
||||
@@ -267,71 +294,86 @@
|
||||
<!-- Modal Nueva Asignatura -->
|
||||
{% if can_edit %}
|
||||
<div class="modal fade" id="modalAddSubject" tabindex="-1" aria-hidden="true">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-dialog modal-lg modal-dialog-centered modal-dialog-scrollable">
|
||||
<div class="modal-content shadow border-0">
|
||||
<form method="POST" action="/admin/subject_add">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title h6 fw-bold">
|
||||
<div class="modal-header border-bottom py-3">
|
||||
<h5 class="modal-title h6 fw-bold mb-0">
|
||||
<i class="bi bi-book text-primary me-2"></i>Nueva Asignatura
|
||||
</h5>
|
||||
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div class="row g-2 mb-3">
|
||||
<div class="col-md-5">
|
||||
<label class="form-label small fw-semibold">Código *</label>
|
||||
<input type="text" name="code" class="form-control form-control-sm font-monospace" placeholder="ej. ASIG0015" required>
|
||||
<div class="modal-body p-4">
|
||||
<div class="row g-4">
|
||||
<!-- Columna Izquierda: Datos de la Asignatura -->
|
||||
<div class="col-md-6 border-end-md">
|
||||
<h6 class="fw-bold mb-3 text-primary d-flex align-items-center">
|
||||
<i class="bi bi-info-circle me-2"></i>Información Académica
|
||||
</h6>
|
||||
<div class="row g-2 mb-3">
|
||||
<div class="col-7">
|
||||
<label class="form-label small fw-semibold">Código *</label>
|
||||
<input type="text" name="code" class="form-control form-control-sm font-monospace" placeholder="ej. ASIG0015" required>
|
||||
</div>
|
||||
<div class="col-5">
|
||||
<label class="form-label small fw-semibold">Créditos *</label>
|
||||
<input type="number" name="credits" class="form-control form-control-sm" value="4" min="1" max="20" required>
|
||||
</div>
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label class="form-label small fw-semibold">Nombre de la Asignatura *</label>
|
||||
<input type="text" name="name" class="form-control form-control-sm" placeholder="ej. Álgebra Lineal" required>
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label class="form-label small fw-semibold">Departamento / Área</label>
|
||||
<input type="text" name="department" class="form-control form-control-sm" placeholder="ej. Ciencias Exactas, Informática">
|
||||
</div>
|
||||
<div class="mb-0">
|
||||
<label class="form-label small fw-semibold">Descripción / Objetivos</label>
|
||||
<textarea name="description" class="form-control form-control-sm" rows="3" placeholder="Programa de la materia, contenidos mínimos..."></textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-7">
|
||||
<label class="form-label small fw-semibold">Créditos</label>
|
||||
<input type="number" name="credits" class="form-control form-control-sm" value="4" min="1" max="20">
|
||||
</div>
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label class="form-label small fw-semibold">Nombre de la Asignatura *</label>
|
||||
<input type="text" name="name" class="form-control form-control-sm" placeholder="ej. Álgebra Lineal" required>
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<div class="d-flex justify-content-between align-items-center mb-1">
|
||||
<label class="form-label small fw-semibold mb-0">
|
||||
<i class="bi bi-mortarboard text-primary me-1"></i>Carreras Vinculadas
|
||||
</label>
|
||||
<span class="badge bg-secondary-subtle text-secondary border rounded-pill" id="addSubjectCareerCount">0 seleccionadas</span>
|
||||
</div>
|
||||
<div class="d-flex justify-content-between align-items-center mb-2 gap-2">
|
||||
<input type="text" class="form-control form-control-sm career-filter-input" placeholder="Filtrar carreras..." data-target="addSubjectCareerList">
|
||||
<div class="btn-group btn-group-sm flex-shrink-0">
|
||||
|
||||
<!-- Columna Derecha: Carreras Vinculadas -->
|
||||
<div class="col-md-6">
|
||||
<div class="d-flex justify-content-between align-items-center mb-2">
|
||||
<h6 class="fw-bold mb-0 text-primary d-flex align-items-center">
|
||||
<i class="bi bi-mortarboard me-2"></i>Planes y Carreras
|
||||
</h6>
|
||||
<span class="badge bg-secondary-subtle text-secondary border rounded-pill px-2 py-1 fs-xs" id="addSubjectCareerCount">0 seleccionadas</span>
|
||||
</div>
|
||||
<div class="input-group input-group-sm mb-2">
|
||||
<span class="input-group-text bg-body-tertiary"><i class="bi bi-search text-muted"></i></span>
|
||||
<input type="text" class="form-control career-filter-input" placeholder="Filtrar carreras..." data-target="addSubjectCareerList">
|
||||
<button type="button" class="btn btn-outline-secondary select-all-careers" data-target="addSubjectCareerList" title="Seleccionar todas las visibles">Todas</button>
|
||||
<button type="button" class="btn btn-outline-secondary deselect-all-careers" data-target="addSubjectCareerList" title="Deseleccionar todas">Ninguna</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="border rounded p-2 bg-body-tertiary" style="max-height: 170px; overflow-y: auto;" id="addSubjectCareerList">
|
||||
{% for c in careers %}
|
||||
<div class="form-check career-item py-1 px-2 mb-1 rounded">
|
||||
<input class="form-check-input career-checkbox" type="checkbox" name="career_ids" value="{{ c.id }}" id="add_career_{{ c.id }}">
|
||||
<label class="form-check-label small d-flex justify-content-between align-items-center w-100 cursor-pointer" for="add_career_{{ c.id }}">
|
||||
<span class="career-label-text fw-medium">{{ c.name }}</span>
|
||||
<span class="badge bg-secondary-subtle text-secondary font-monospace ms-2">{{ c.code or ('ID ' + c.id) }}</span>
|
||||
<div class="border rounded p-2 bg-body-tertiary" style="max-height: 250px; min-height: 180px; overflow-y: auto;" id="addSubjectCareerList">
|
||||
{% for c in careers %}
|
||||
<label class="career-item d-flex align-items-center justify-content-between p-2 mb-1 rounded border border-secondary-subtle bg-body hover-item cursor-pointer" for="add_career_{{ c.id }}">
|
||||
<div class="form-check mb-0 d-flex align-items-center">
|
||||
<input class="form-check-input career-checkbox me-2" type="checkbox" name="career_ids" value="{{ c.id }}" id="add_career_{{ c.id }}">
|
||||
<span class="career-label-text small fw-medium">{{ c.name }}</span>
|
||||
</div>
|
||||
<span class="badge bg-secondary-subtle text-secondary font-monospace ms-2 flex-shrink-0">{{ c.code or ('ID ' + c.id) }}</span>
|
||||
</label>
|
||||
{% else %}
|
||||
<p class="text-muted small mb-0 p-3 text-center">No hay carreras registradas.</p>
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% else %}
|
||||
<p class="text-muted small mb-0 p-2 text-center">No hay carreras registradas.</p>
|
||||
{% endfor %}
|
||||
<small class="text-muted d-block mt-2 lh-sm fs-xs">
|
||||
<i class="bi bi-info-circle me-1"></i>Podés asociar la asignatura a una o varias carreras para compartirla en sus planes de estudio.
|
||||
</small>
|
||||
</div>
|
||||
<small class="text-muted d-block mt-1">Podés seleccionar una o más carreras para asociar esta asignatura a múltiples planes de estudio.</small>
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label class="form-label small fw-semibold">Departamento / Área</label>
|
||||
<input type="text" name="department" class="form-control form-control-sm" placeholder="ej. Ciencias Exactas, Informática">
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label class="form-label small fw-semibold">Descripción</label>
|
||||
<textarea name="description" class="form-control form-control-sm" rows="2" placeholder="Programa de la materia..."></textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-sm btn-secondary" data-bs-dismiss="modal">Cancelar</button>
|
||||
<button type="submit" class="btn btn-sm btn-primary">Crear Asignatura</button>
|
||||
<div class="modal-footer bg-body-tertiary border-top py-2 px-3">
|
||||
<button type="button" class="btn btn-sm btn-outline-secondary px-3" data-bs-dismiss="modal">
|
||||
<i class="bi bi-x-lg me-1"></i>Cancelar
|
||||
</button>
|
||||
<button type="submit" class="btn btn-sm btn-primary px-4 shadow-sm">
|
||||
<i class="bi bi-plus-lg me-1"></i>Crear Asignatura
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
@@ -340,76 +382,91 @@
|
||||
|
||||
<!-- Modal Editar Asignatura (Global fuera de la tabla para evitar problemas de visualización) -->
|
||||
<div class="modal fade" id="modalEditSubject" tabindex="-1" aria-hidden="true">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-dialog modal-lg modal-dialog-centered modal-dialog-scrollable">
|
||||
<div class="modal-content shadow border-0">
|
||||
<form method="POST" action="/admin/subject_edit" id="formEditSubject">
|
||||
<input type="hidden" name="id" id="editSubjectId">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title h6 fw-bold">
|
||||
<div class="modal-header border-bottom py-3">
|
||||
<h5 class="modal-title h6 fw-bold mb-0">
|
||||
<i class="bi bi-pencil-square text-primary me-2"></i>Editar Asignatura
|
||||
</h5>
|
||||
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div class="row g-2 mb-3">
|
||||
<div class="col-md-5">
|
||||
<label class="form-label small fw-semibold">Código *</label>
|
||||
<input type="text" name="code" id="editSubjectCode" class="form-control form-control-sm font-monospace" required>
|
||||
<div class="modal-body p-4">
|
||||
<div class="row g-4">
|
||||
<!-- Columna Izquierda: Datos de la Asignatura -->
|
||||
<div class="col-md-6 border-end-md">
|
||||
<h6 class="fw-bold mb-3 text-primary d-flex align-items-center">
|
||||
<i class="bi bi-info-circle me-2"></i>Información Académica
|
||||
</h6>
|
||||
<div class="row g-2 mb-3">
|
||||
<div class="col-7">
|
||||
<label class="form-label small fw-semibold">Código *</label>
|
||||
<input type="text" name="code" id="editSubjectCode" class="form-control form-control-sm font-monospace" required>
|
||||
</div>
|
||||
<div class="col-5">
|
||||
<label class="form-label small fw-semibold">Créditos *</label>
|
||||
<input type="number" name="credits" id="editSubjectCredits" class="form-control form-control-sm" min="1" max="20" required>
|
||||
</div>
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label class="form-label small fw-semibold">Nombre de la Asignatura *</label>
|
||||
<input type="text" name="name" id="editSubjectName" class="form-control form-control-sm" required>
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label class="form-label small fw-semibold">Departamento / Área</label>
|
||||
<input type="text" name="department" id="editSubjectDept" class="form-control form-control-sm" placeholder="ej. Ciencias Exactas, Informática">
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label class="form-label small fw-semibold">Descripción / Objetivos</label>
|
||||
<textarea name="description" id="editSubjectDesc" class="form-control form-control-sm" rows="3" placeholder="Programa de la materia..."></textarea>
|
||||
</div>
|
||||
<div class="form-check form-switch mt-2">
|
||||
<input class="form-check-input" type="checkbox" name="is_active" id="editSubjectActive" role="switch">
|
||||
<label class="form-check-label small fw-semibold" for="editSubjectActive">Asignatura Activa</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-7">
|
||||
<label class="form-label small fw-semibold">Créditos</label>
|
||||
<input type="number" name="credits" id="editSubjectCredits" class="form-control form-control-sm" min="1" max="20">
|
||||
</div>
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label class="form-label small fw-semibold">Nombre de la Asignatura *</label>
|
||||
<input type="text" name="name" id="editSubjectName" class="form-control form-control-sm" required>
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<div class="d-flex justify-content-between align-items-center mb-1">
|
||||
<label class="form-label small fw-semibold mb-0">
|
||||
<i class="bi bi-mortarboard text-primary me-1"></i>Carreras Vinculadas
|
||||
</label>
|
||||
<span class="badge bg-secondary-subtle text-secondary border rounded-pill" id="editSubjectCareerCount">0 seleccionadas</span>
|
||||
</div>
|
||||
<div class="d-flex justify-content-between align-items-center mb-2 gap-2">
|
||||
<input type="text" class="form-control form-control-sm career-filter-input" placeholder="Filtrar carreras..." data-target="editSubjectCareerList">
|
||||
<div class="btn-group btn-group-sm flex-shrink-0">
|
||||
|
||||
<!-- Columna Derecha: Carreras Vinculadas -->
|
||||
<div class="col-md-6">
|
||||
<div class="d-flex justify-content-between align-items-center mb-2">
|
||||
<h6 class="fw-bold mb-0 text-primary d-flex align-items-center">
|
||||
<i class="bi bi-mortarboard me-2"></i>Planes y Carreras
|
||||
</h6>
|
||||
<span class="badge bg-secondary-subtle text-secondary border rounded-pill px-2 py-1 fs-xs" id="editSubjectCareerCount">0 seleccionadas</span>
|
||||
</div>
|
||||
<div class="input-group input-group-sm mb-2">
|
||||
<span class="input-group-text bg-body-tertiary"><i class="bi bi-search text-muted"></i></span>
|
||||
<input type="text" class="form-control career-filter-input" placeholder="Filtrar carreras..." data-target="editSubjectCareerList">
|
||||
<button type="button" class="btn btn-outline-secondary select-all-careers" data-target="editSubjectCareerList" title="Seleccionar todas las visibles">Todas</button>
|
||||
<button type="button" class="btn btn-outline-secondary deselect-all-careers" data-target="editSubjectCareerList" title="Deseleccionar todas">Ninguna</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="border rounded p-2 bg-body-tertiary" style="max-height: 170px; overflow-y: auto;" id="editSubjectCareerList">
|
||||
{% for c in careers %}
|
||||
<div class="form-check career-item py-1 px-2 mb-1 rounded">
|
||||
<input class="form-check-input career-checkbox" type="checkbox" name="career_ids" value="{{ c.id }}" id="edit_career_{{ c.id }}">
|
||||
<label class="form-check-label small d-flex justify-content-between align-items-center w-100 cursor-pointer" for="edit_career_{{ c.id }}">
|
||||
<span class="career-label-text fw-medium">{{ c.name }}</span>
|
||||
<span class="badge bg-secondary-subtle text-secondary font-monospace ms-2">{{ c.code or ('ID ' + c.id) }}</span>
|
||||
<div class="border rounded p-2 bg-body-tertiary" style="max-height: 250px; min-height: 180px; overflow-y: auto;" id="editSubjectCareerList">
|
||||
{% for c in careers %}
|
||||
<label class="career-item d-flex align-items-center justify-content-between p-2 mb-1 rounded border border-secondary-subtle bg-body hover-item cursor-pointer" for="edit_career_{{ c.id }}">
|
||||
<div class="form-check mb-0 d-flex align-items-center">
|
||||
<input class="form-check-input career-checkbox me-2" type="checkbox" name="career_ids" value="{{ c.id }}" id="edit_career_{{ c.id }}">
|
||||
<span class="career-label-text small fw-medium">{{ c.name }}</span>
|
||||
</div>
|
||||
<span class="badge bg-secondary-subtle text-secondary font-monospace ms-2 flex-shrink-0">{{ c.code or ('ID ' + c.id) }}</span>
|
||||
</label>
|
||||
{% else %}
|
||||
<p class="text-muted small mb-0 p-3 text-center">No hay carreras registradas.</p>
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% else %}
|
||||
<p class="text-muted small mb-0 p-2 text-center">No hay carreras registradas.</p>
|
||||
{% endfor %}
|
||||
<small class="text-muted d-block mt-2 lh-sm fs-xs">
|
||||
<i class="bi bi-info-circle me-1"></i>Podés asociar la asignatura a una o varias carreras para compartirla en sus planes de estudio.
|
||||
</small>
|
||||
</div>
|
||||
<small class="text-muted d-block mt-1">Podés seleccionar una o más carreras para asociar esta asignatura a múltiples planes de estudio.</small>
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label class="form-label small fw-semibold">Departamento / Área</label>
|
||||
<input type="text" name="department" id="editSubjectDept" class="form-control form-control-sm">
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label class="form-label small fw-semibold">Descripción / Objetivos</label>
|
||||
<textarea name="description" id="editSubjectDesc" class="form-control form-control-sm" rows="2"></textarea>
|
||||
</div>
|
||||
<div class="form-check">
|
||||
<input class="form-check-input" type="checkbox" name="is_active" id="editSubjectActive">
|
||||
<label class="form-check-label small" for="editSubjectActive">Asignatura Activa</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-sm btn-secondary" data-bs-dismiss="modal">Cancelar</button>
|
||||
<button type="submit" class="btn btn-sm btn-primary">Guardar Cambios</button>
|
||||
<div class="modal-footer bg-body-tertiary border-top py-2 px-3">
|
||||
<button type="button" class="btn btn-sm btn-outline-secondary px-3" data-bs-dismiss="modal">
|
||||
<i class="bi bi-x-lg me-1"></i>Cancelar
|
||||
</button>
|
||||
<button type="submit" class="btn btn-sm btn-primary px-4 shadow-sm">
|
||||
<i class="bi bi-check-lg me-1"></i>Guardar Cambios
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
@@ -453,9 +510,9 @@ document.addEventListener('DOMContentLoaded', function() {
|
||||
var checked = container.querySelectorAll('.career-checkbox:checked').length;
|
||||
badge.textContent = checked + (checked === 1 ? ' seleccionada' : ' seleccionadas');
|
||||
if (checked > 0) {
|
||||
badge.className = 'badge bg-primary text-white rounded-pill';
|
||||
badge.className = 'badge bg-primary text-white rounded-pill px-2 py-1 fs-xs';
|
||||
} else {
|
||||
badge.className = 'badge bg-secondary-subtle text-secondary border rounded-pill';
|
||||
badge.className = 'badge bg-secondary-subtle text-secondary border rounded-pill px-2 py-1 fs-xs';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user