feat: release v3.5.0 - formal MVP Bedelia closure, SDD harness, cartelera export, docs cleanup & model fixes

This commit is contained in:
2026-10-16 13:18:02 -03:00
parent 94009ec552
commit 39c80f573b
53 changed files with 767 additions and 32 deletions
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "frontend",
"version": "3.4.9",
"version": "3.5.0",
"description": "",
"main": "index.js",
"scripts": {
+3 -3
View File
@@ -85,9 +85,9 @@ const env = nunjucks.configure(path.join(__dirname, '../views'), {
});
// Versiones institucionales del sistema
const APP_VERSION = '3.4.9';
const FRONTEND_VERSION = '3.4.9';
const BACKEND_VERSION = '3.4.9';
const APP_VERSION = '3.5.0';
const FRONTEND_VERSION = '3.5.0';
const BACKEND_VERSION = '3.5.0';
env.addGlobal('app_version', APP_VERSION);
env.addGlobal('frontend_version', FRONTEND_VERSION);
+81
View File
@@ -432,6 +432,87 @@ const handleTodaySchedule = async (req, res) => {
router.get('/today', handleTodaySchedule);
router.get('/today_schedule', handleTodaySchedule);
// Exportar cartelera a CSV compatible con Excel (UTF-8 con BOM)
const handleExportScheduleCsv = async (req, res) => {
try {
const dateStr = req.query.date || new Date().toISOString().split('T')[0];
const params = { start_date: dateStr, end_date: dateStr };
if (req.query.hide_virtual === '1') params.hide_virtual = '1';
if (req.query.floor) params.floor = req.query.floor;
if (req.query.shift) params.shift = req.query.shift;
const response = await req.apiClient.get('/reservations', { params });
const rawReservations = (response.data && response.data.reservations) || [];
const reservations = rawReservations.map(formatReservationDates);
reservations.sort((a, b) => (a.start_time || '').localeCompare(b.start_time || ''));
const headers = [
'Fecha',
'Horario',
'Turno',
'Aula / Espacio',
'Piso / Sede',
'Modalidad',
'Materia',
'Código Materia',
'Comisión',
'Carrera',
'Docente / Cátedra',
'Alumnos Estimados',
'Estado',
'Enlace Virtual'
];
const escapeCsv = (val) => {
if (val === null || val === undefined) return '""';
const s = String(val).replace(/"/g, '""');
return `"${s}"`;
};
const rows = reservations.map(r => {
const isVirtual = Boolean(r.virtual_link || (r.classroom_name && r.classroom_name.includes('VIRTUAL')));
const roomName = r.classroom_name || (r.classroom ? r.classroom.code : 'Aula');
const building = (r.classroom && r.classroom.building) || 'Sede Central';
const subjectName = r.subject_name || r.purpose || 'Clase Regular';
const subjectCode = r.subject_code || (r.commission && r.commission.subject_code) || '';
const commissionCode = (r.commission && r.commission.code) || r.commission_code || '';
const careerName = (r.commission && r.commission.career_names) || (r.commission && r.commission.career_name) || r.career_names || r.career_name || '';
const teacherName = r.teacher_name || (r.user ? r.user.full_name : '');
const virtualLink = r.effective_virtual_link || r.virtual_link || '';
return [
escapeCsv(r.date_display || dateStr),
escapeCsv(r.time_display || `${r.start_time} - ${r.end_time}`),
escapeCsv(r.shift || 'Mañana'),
escapeCsv(roomName),
escapeCsv(building),
escapeCsv(isVirtual ? 'Virtual' : 'Presencial'),
escapeCsv(subjectName),
escapeCsv(subjectCode),
escapeCsv(commissionCode),
escapeCsv(careerName),
escapeCsv(teacherName),
escapeCsv(r.expected_attendees || 30),
escapeCsv(r.status || 'CONFIRMED'),
escapeCsv(virtualLink)
].join(';');
});
// BOM UTF-8 (\uFEFF) para abrir directamente en Microsoft Excel sin problemas de encoding
const csvContent = '\uFEFF' + [headers.join(';'), ...rows].join('\r\n');
res.setHeader('Content-Type', 'text/csv; charset=utf-8');
res.setHeader('Content-Disposition', `attachment; filename="cartelera_unicaba_${dateStr}.csv"`);
res.status(200).send(csvContent);
} catch (error) {
console.error('Error generating schedule CSV:', error.message);
res.status(500).send('Error al exportar la cartelera');
}
};
router.get('/export_csv', handleExportScheduleCsv);
const { createFormMock } = require('../utils/formHelper');
// 5. Vista de Crear Reserva
+24 -1
View File
@@ -266,7 +266,14 @@
{{ log.details or '-' }}
</div>
{% if log.details and log.details.length > 50 %}
<button type="button" class="btn btn-link btn-sm p-0 text-decoration-none text-primary" onclick="showLogDetailModal('{{ log.id }}', '{{ log.action }}', '{{ log.module }}', '{{ log.user_email or 'Sistema' }}', '{{ log.created_at }}', '{{ log.ip_address }}', {{ log.details | dump | escape }})">
<button type="button" class="btn btn-link btn-sm p-0 text-decoration-none text-primary btn-view-log-detail"
data-log-id="{{ log.id }}"
data-log-action="{{ log.action }}"
data-log-module="{{ log.module }}"
data-log-user="{% if log.user_email %}{{ log.user_email }}{% else %}Sistema{% endif %}"
data-log-time="{{ log.created_at }}"
data-log-ip="{{ log.ip_address or '-' }}"
data-log-details="{{ log.details | escape }}">
<i class="bi bi-eye"></i>
</button>
{% endif %}
@@ -402,5 +409,21 @@ function copyModalDetails() {
alert('Detalle copiado al portapapeles.');
});
}
document.addEventListener('DOMContentLoaded', function() {
document.querySelectorAll('.btn-view-log-detail').forEach(function(btn) {
btn.addEventListener('click', function() {
showLogDetailModal(
this.dataset.logId,
this.dataset.logAction,
this.dataset.logModule,
this.dataset.logUser,
this.dataset.logTime,
this.dataset.logIp,
this.dataset.logDetails
);
});
});
});
</script>
{% endblock %}
+10
View File
@@ -1347,6 +1347,16 @@
</div>
</a>
</div>
<div class="col-md-12 col-lg-12 mt-2">
<div class="d-flex justify-content-end gap-2">
<a href="/schedule/export_csv" class="btn btn-sm btn-outline-success">
<i class="bi bi-file-earmark-excel me-1"></i>Descargar Planilla del Día (Excel / CSV)
</a>
<a href="/schedule/today_schedule" class="btn btn-sm btn-outline-primary">
<i class="bi bi-printer me-1"></i>Abrir Cartelera Imprimible
</a>
</div>
</div>
</div>
</div>
</div>
+62
View File
@@ -4,6 +4,13 @@
{% block content %}
<div class="container-fluid px-0">
<!-- Membrete exclusivo para impresión A4 de recepción y bedelía -->
<div class="print-header text-center mb-4">
<h2 class="fw-bold mb-1">Universidad de la Ciudad de Buenos Aires (UniCABA)</h2>
<h4 class="text-secondary mb-1">Cartelera Oficial de Asignación de Aulas y Cursadas</h4>
<p class="mb-0 fs-6">Fecha: <strong>{{ format_date(today, format='full')|capitalize }}</strong> — Plataforma Admin Edu-Space Bedelía</p>
</div>
<!-- Header -->
<div class="row mb-3 align-items-center">
<div class="col-md-7">
@@ -14,6 +21,12 @@
<p class="text-muted small mb-0">Cronograma de clases y asignación de aulas activas para el día de hoy</p>
</div>
<div class="col-md-5 text-md-end mt-3 mt-md-0">
<a href="/schedule/export_csv?date={{ today }}{% if hide_virtual %}&hide_virtual=1{% endif %}{% if floor_filter %}&floor={{ floor_filter }}{% endif %}{% if shift_filter %}&shift={{ shift_filter }}{% endif %}" class="btn btn-outline-success me-2" title="Descargar como planilla Excel/CSV">
<i class="bi bi-file-earmark-excel me-1"></i>Excel / CSV
</a>
<button type="button" class="btn btn-outline-dark me-2" onclick="window.print()" title="Imprimir cartelera del día">
<i class="bi bi-printer me-1"></i>Imprimir
</button>
{% if user.has_permission('reservations', 'read_write') %}
<a href="/schedule/add_reservation" class="btn btn-success me-2">
<i class="bi bi-plus-circle me-1"></i>Nueva Reserva
@@ -426,4 +439,53 @@ document.addEventListener('DOMContentLoaded', function() {
}
});
</script>
<style>
@media print {
body {
background-color: #ffffff !important;
color: #000000 !important;
font-size: 10pt !important;
}
.sidebar, .navbar, .btn, .breadcrumb, form, .card-footer, #refresh-btn, #toggle-view-btn, .pagination, .alert, .badge.bg-opacity-10 {
display: none !important;
}
.main-content, .container-fluid, .content-wrapper, main {
margin: 0 !important;
padding: 0 !important;
width: 100% !important;
max-width: 100% !important;
}
.print-header {
display: block !important;
margin-bottom: 1.5rem !important;
border-bottom: 2px solid #000 !important;
padding-bottom: 0.5rem !important;
}
.card {
border: 1px solid #cccccc !important;
box-shadow: none !important;
break-inside: avoid;
margin-bottom: 1rem !important;
}
.table {
border-collapse: collapse !important;
width: 100% !important;
}
.table td, .table th {
border: 1px solid #dddddd !important;
padding: 6px 8px !important;
color: #000 !important;
}
a {
text-decoration: none !important;
color: #000 !important;
}
}
@media screen {
.print-header {
display: none !important;
}
}
</style>
{% endblock %}