fix: normalizar sync de google sheets para todos los dias, reparar 500 en ciclos lectivos, selector de ciclo lectivo en comisiones y opciones --keep-db --keep-users en install.sh
This commit is contained in:
@@ -129,7 +129,7 @@
|
||||
<div class="modal fade text-start" id="modalEditTerm{{ term.id }}" tabindex="-1" aria-labelledby="modalEditTermTitle{{ term.id }}" aria-hidden="true" data-bs-backdrop="static">
|
||||
<div class="modal-dialog modal-dialog-centered">
|
||||
<div class="modal-content shadow-lg border-0">
|
||||
<form method="POST" action="{{ url_for('admin.academic_term_edit', id=term.id) }}">
|
||||
<form method="POST" action="/admin/academic_term_edit/{{ term.id }}">
|
||||
<input type="hidden" name="id" value="{{ term.id }}">
|
||||
<div class="modal-header border-bottom">
|
||||
<h5 class="modal-title h6 fw-bold" id="modalEditTermTitle{{ term.id }}">
|
||||
|
||||
@@ -277,9 +277,23 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 2. Período, Año y Turno -->
|
||||
<!-- 2. Ciclo Lectivo, Período, Año y Turno -->
|
||||
<div class="row g-3 mb-3">
|
||||
<div class="col-md-4">
|
||||
<div class="col-md-6">
|
||||
<label for="add_academic_term_id" class="form-label fw-semibold small">
|
||||
<i class="bi bi-calendar-range text-primary me-1"></i>Ciclo Lectivo
|
||||
</label>
|
||||
<select class="form-select form-select-sm" id="add_academic_term_id" name="academic_term_id">
|
||||
<option value="">-- Seleccionar Ciclo Lectivo --</option>
|
||||
{% for term in academic_terms %}
|
||||
<option value="{{ term.id }}" data-year="{{ term.year }}" data-period="{{ term.period_type }}" data-code="{{ term.code }}" {% if term.is_current %}selected{% endif %}>
|
||||
{{ term.name }} ({{ term.code }}){% if term.is_current %} [Actual]{% endif %}
|
||||
</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
<div class="form-text small">Asocia la comisión al calendario académico.</div>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<label for="add_semester" class="form-label fw-semibold small">Cuatrimestre / Período</label>
|
||||
<select class="form-select form-select-sm" id="add_semester" name="semester">
|
||||
<option value="1C" selected>1C (Primer Cuatrimestre)</option>
|
||||
@@ -287,11 +301,13 @@
|
||||
<option value="Anual">Anual</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<div class="col-md-3">
|
||||
<label for="add_year" class="form-label fw-semibold small">Año Académico</label>
|
||||
<input type="number" class="form-control form-control-sm" id="add_year" name="year" value="2026" min="2020" max="2035">
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
</div>
|
||||
<div class="row g-3 mb-3">
|
||||
<div class="col-md-6">
|
||||
<label for="add_shift" class="form-label fw-semibold small">Turno de Cursada</label>
|
||||
<select class="form-select form-select-sm" id="add_shift" name="shift">
|
||||
<option value="Mañana">Mañana (08:00 - 12:00)</option>
|
||||
@@ -349,4 +365,36 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
const termSelect = document.getElementById('add_academic_term_id');
|
||||
const yearInput = document.getElementById('add_year');
|
||||
const semSelect = document.getElementById('add_semester');
|
||||
|
||||
function syncTerm() {
|
||||
if (!termSelect) return;
|
||||
const opt = termSelect.options[termSelect.selectedIndex];
|
||||
if (!opt || !opt.value) return;
|
||||
const yr = opt.getAttribute('data-year');
|
||||
const period = (opt.getAttribute('data-period') || opt.text || '').toLowerCase();
|
||||
const code = (opt.getAttribute('data-code') || '').toLowerCase();
|
||||
if (yr && yearInput) yearInput.value = yr;
|
||||
if (semSelect) {
|
||||
if (period.includes('segundo') || code.includes('2c') || code.includes('2º') || code.includes('2do') || code.includes('-2')) {
|
||||
semSelect.value = '2C';
|
||||
} else if (period.includes('anual') || code.includes('anual')) {
|
||||
semSelect.value = 'Anual';
|
||||
} else if (period.includes('primer') || code.includes('1c') || code.includes('1º') || code.includes('1ro') || code.includes('-1')) {
|
||||
semSelect.value = '1C';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (termSelect) {
|
||||
termSelect.addEventListener('change', syncTerm);
|
||||
if (termSelect.value) syncTerm();
|
||||
}
|
||||
});
|
||||
</script>
|
||||
{% endblock %}
|
||||
|
||||
Reference in New Issue
Block a user