feat: implementacion de dashboards por rol, soporte de clases virtuales concurrentes en importador de sheets y cartelera del dia
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
{% extends "base.html" %}
|
||||
|
||||
{% block title %}Acceso Denegado (403) - Edu-Space Admin{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<div class="container pt-5 mt-5 text-center">
|
||||
<div class="row justify-content-center">
|
||||
<div class="col-md-6">
|
||||
<div class="card border-0 shadow-sm p-5">
|
||||
<div class="text-danger mb-3" style="font-size: 4rem;">
|
||||
<i class="bi bi-shield-x"></i>
|
||||
</div>
|
||||
<h1 class="h2 mb-2">403 - Acceso Denegado</h1>
|
||||
<p class="text-muted mb-4">
|
||||
No tienes los permisos necesarios para acceder a este recurso. Esta sección está restringida exclusivamente a administradores.
|
||||
</p>
|
||||
<div>
|
||||
<a href="/main/dashboard" class="btn btn-primary">
|
||||
<i class="bi bi-house me-1"></i>Ir al Dashboard
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
@@ -0,0 +1,62 @@
|
||||
{% extends "base.html" %}
|
||||
|
||||
{% block title %}Cambiar Contraseña - Edu-Space Admin{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<div class="container pt-5 mt-4">
|
||||
<div class="row justify-content-center">
|
||||
<div class="col-lg-6 col-md-8">
|
||||
<!-- Header -->
|
||||
<div class="d-flex align-items-center justify-content-between mb-4">
|
||||
<h1 class="h3 mb-0">
|
||||
<i class="bi bi-shield-lock text-primary me-2"></i>Cambiar Contraseña
|
||||
</h1>
|
||||
<a href="/auth/profile" class="btn btn-outline-secondary btn-sm">
|
||||
<i class="bi bi-arrow-left me-1"></i>Volver al Perfil
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<!-- Form Card -->
|
||||
<div class="card border-0 shadow-sm">
|
||||
<div class="card-body p-4">
|
||||
<form method="POST" action="/auth/change_password">
|
||||
<div class="mb-3">
|
||||
<label for="current_password" class="form-label">Contraseña Actual</label>
|
||||
<div class="input-group">
|
||||
<span class="input-group-text"><i class="bi bi-lock"></i></span>
|
||||
<input type="password" class="form-control" id="current_password" name="current_password" required placeholder="Ingresa tu contraseña actual">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="mb-3">
|
||||
<label for="new_password" class="form-label">Nueva Contraseña</label>
|
||||
<div class="input-group">
|
||||
<span class="input-group-text"><i class="bi bi-key"></i></span>
|
||||
<input type="password" class="form-control" id="new_password" name="new_password" required minlength="6" placeholder="Mínimo 6 caracteres">
|
||||
</div>
|
||||
<div class="form-text">Debe tener al menos 6 caracteres.</div>
|
||||
</div>
|
||||
|
||||
<div class="mb-4">
|
||||
<label for="confirm_password" class="form-label">Confirmar Nueva Contraseña</label>
|
||||
<div class="input-group">
|
||||
<span class="input-group-text"><i class="bi bi-check2-circle"></i></span>
|
||||
<input type="password" class="form-control" id="confirm_password" name="confirm_password" required minlength="6" placeholder="Repite la nueva contraseña">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="d-grid gap-2">
|
||||
<button type="submit" class="btn btn-primary">
|
||||
<i class="bi bi-save me-1"></i>Actualizar Contraseña
|
||||
</button>
|
||||
<a href="/auth/profile" class="btn btn-link text-muted">
|
||||
Cancelar
|
||||
</a>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
@@ -0,0 +1,151 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="es" data-bs-theme="dark">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Login - Edu-Space Admin</title>
|
||||
|
||||
<!-- Favicon -->
|
||||
<link rel="icon" type="image/png" href="/img/favicon.png">
|
||||
|
||||
<!-- Script Anti-Flicker para Modo Claro / Oscuro -->
|
||||
<script>
|
||||
(function() {
|
||||
const storedTheme = localStorage.getItem('theme');
|
||||
const theme = storedTheme || (window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light');
|
||||
document.documentElement.setAttribute('data-bs-theme', theme);
|
||||
})();
|
||||
</script>
|
||||
|
||||
<!-- Bootstrap 5 CSS -->
|
||||
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet">
|
||||
<link href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.10.0/font/bootstrap-icons.css" rel="stylesheet">
|
||||
<!-- Design System Theme -->
|
||||
<link href="/css/theme.css" rel="stylesheet">
|
||||
</head>
|
||||
<body>
|
||||
<div class="auth-wrapper">
|
||||
<div class="auth-card">
|
||||
<!-- Header con Controles Superiores & Logo Oficial -->
|
||||
<div class="auth-header">
|
||||
<div class="auth-controls">
|
||||
<button class="theme-toggle-btn" type="button" aria-label="Cambiar tema" title="Modo Claro/Oscuro">
|
||||
<i class="bi bi-moon-stars-fill"></i>
|
||||
</button>
|
||||
<!-- Language Switcher could go here -->
|
||||
</div>
|
||||
|
||||
<img src="/img/logo_unicaba.png" alt="UniCABA" class="auth-logo">
|
||||
<h4 class="fw-bold mb-1">Edu-Space Admin</h4>
|
||||
<p class="text-muted small mb-0">Classroom Management System</p>
|
||||
</div>
|
||||
|
||||
<div class="px-4 pb-4 pt-2">
|
||||
<!-- Flash Messages -->
|
||||
{% if error %}
|
||||
<div class="alert alert-danger alert-dismissible fade show rounded-3 py-2 small" role="alert">
|
||||
{{ error }}
|
||||
<button type="button" class="btn-close py-2" data-bs-dismiss="alert"></button>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
<form action="/auth/login" method="POST" novalidate>
|
||||
<div class="mb-3">
|
||||
<label for="username" class="form-label small fw-semibold text-muted">Correo Electrónico</label>
|
||||
<div class="input-group">
|
||||
<span class="input-group-text bg-body-tertiary border-end-0 text-muted">
|
||||
<i class="bi bi-envelope"></i>
|
||||
</span>
|
||||
<input type="email" class="form-control border-start-0 ps-0" id="username" name="username"
|
||||
required placeholder="Ingresa tu correo">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="mb-3">
|
||||
<label for="password" class="form-label small fw-semibold text-muted">Contraseña</label>
|
||||
<div class="input-group">
|
||||
<span class="input-group-text bg-body-tertiary border-end-0 text-muted">
|
||||
<i class="bi bi-lock"></i>
|
||||
</span>
|
||||
<input type="password" class="form-control border-start-0 border-end-0 ps-0" id="password" name="password"
|
||||
required placeholder="Ingresa tu contraseña">
|
||||
<button class="btn btn-outline-secondary border-start-0 bg-body-tertiary text-muted" type="button" id="togglePasswordBtn" title="Mostrar/Ocultar contraseña">
|
||||
<i class="bi bi-eye" id="togglePasswordIcon"></i>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="d-grid mb-3 mt-4">
|
||||
<button type="submit" class="btn btn-primary btn-lg fw-semibold py-2">
|
||||
<i class="bi bi-box-arrow-in-right me-1"></i> Iniciar Sesión
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<!-- Accesos Rápidos Institucionales (Demo) -->
|
||||
<div class="p-3 bg-body-tertiary rounded-3 border mt-3">
|
||||
<div class="d-flex justify-content-between align-items-center mb-2">
|
||||
<small class="fw-bold text-muted text-uppercase" style="font-size: 0.7rem; letter-spacing: 0.5px;">
|
||||
<i class="bi bi-lightning-charge-fill text-warning me-1"></i>Acceso Rápido Demo (1 Clic)
|
||||
</small>
|
||||
<small class="text-muted font-monospace" style="font-size: 0.68rem;">Pass: admin123</small>
|
||||
</div>
|
||||
<div class="d-grid gap-1">
|
||||
<div class="btn-group btn-group-sm w-100" role="group">
|
||||
<button type="button" class="btn btn-outline-primary demo-fill-btn py-1" data-email="admin@edu-space.com" title="Ingresar como Administrador">
|
||||
<i class="bi bi-shield-check me-1"></i>Admin
|
||||
</button>
|
||||
<button type="button" class="btn btn-outline-warning demo-fill-btn py-1" data-email="bedelia@edu-space.com" title="Ingresar como Bedelía">
|
||||
<i class="bi bi-building-gear me-1"></i>Bedelía
|
||||
</button>
|
||||
<button type="button" class="btn btn-outline-info demo-fill-btn py-1" data-email="docente@edu-space.com" title="Ingresar como Docente">
|
||||
<i class="bi bi-person-video3 me-1"></i>Docente
|
||||
</button>
|
||||
<button type="button" class="btn btn-outline-success demo-fill-btn py-1" data-email="alumno@edu-space.com" title="Ingresar como Alumno">
|
||||
<i class="bi bi-mortarboard me-1"></i>Alumno
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="text-center mt-3">
|
||||
<small class="text-muted d-inline-flex align-items-center" style="font-size: 0.75rem;">
|
||||
<i class="bi bi-shield-check text-primary me-1"></i>
|
||||
Acceso institucional seguro • Actividad auditada
|
||||
</small>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"></script>
|
||||
<script src="/js/theme-toggle.js"></script>
|
||||
<script>
|
||||
// Toggle password visibility
|
||||
document.getElementById('togglePasswordBtn').addEventListener('click', function() {
|
||||
const pwdInput = document.getElementById('password');
|
||||
const icon = document.getElementById('togglePasswordIcon');
|
||||
if (pwdInput.type === 'password') {
|
||||
pwdInput.type = 'text';
|
||||
icon.classList.replace('bi-eye', 'bi-eye-slash');
|
||||
} else {
|
||||
pwdInput.type = 'password';
|
||||
icon.classList.replace('bi-eye-slash', 'bi-eye');
|
||||
}
|
||||
});
|
||||
|
||||
// Demo login autofill buttons
|
||||
document.querySelectorAll('.demo-fill-btn').forEach(btn => {
|
||||
btn.addEventListener('click', function() {
|
||||
const email = this.getAttribute('data-email');
|
||||
document.getElementById('username').value = email;
|
||||
document.getElementById('password').value = 'admin123';
|
||||
// Highlight input briefly
|
||||
const emailInput = document.getElementById('username');
|
||||
emailInput.classList.add('is-valid');
|
||||
setTimeout(() => emailInput.classList.remove('is-valid'), 1500);
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,188 @@
|
||||
{% extends "base.html" %}
|
||||
|
||||
{% block title %}User Profile - Edu-Space Admin{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<div class="container pt-5 mt-4">
|
||||
<div class="row justify-content-center">
|
||||
<div class="col-lg-8">
|
||||
<!-- Header -->
|
||||
<div class="d-flex align-items-center justify-content-between mb-4">
|
||||
<h1 class="h3 mb-0">
|
||||
<i class="bi bi-person-badge text-primary me-2"></i>My Profile
|
||||
</h1>
|
||||
<a href="/main/dashboard" class="btn btn-outline-secondary btn-sm">
|
||||
<i class="bi bi-arrow-left me-1"></i>Dashboard
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<!-- Profile Card -->
|
||||
<div class="card border-0 shadow-sm mb-4">
|
||||
<div class="card-body p-4">
|
||||
<div class="d-flex align-items-center mb-4">
|
||||
<div class="bg-primary text-white rounded-circle d-flex align-items-center justify-content-center me-3" style="width: 72px; height: 72px; font-size: 2rem;">
|
||||
<i class="bi bi-person"></i>
|
||||
</div>
|
||||
<div>
|
||||
<h4 class="mb-1">{{ user.name }}</h4>
|
||||
<div class="d-flex align-items-center gap-2">
|
||||
<span class="badge bg-primary">{{ user.role }}</span>
|
||||
{% if user.is_active %}
|
||||
<span class="badge bg-success"><i class="bi bi-check-circle me-1"></i>Active</span>
|
||||
{% else %}
|
||||
<span class="badge bg-danger"><i class="bi bi-x-circle me-1"></i>Inactive</span>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<hr class="my-4">
|
||||
|
||||
<!-- User Details Grid -->
|
||||
<div class="row g-3">
|
||||
<div class="col-sm-6">
|
||||
<label class="form-label text-muted small mb-1">Email</label>
|
||||
<div class="fw-semibold">{{ user.email }}</div>
|
||||
</div>
|
||||
<div class="col-sm-6">
|
||||
<label class="form-label text-muted small mb-1">Full Name</label>
|
||||
<div class="fw-semibold">{{ user.name }}</div>
|
||||
</div>
|
||||
<div class="col-sm-6">
|
||||
<label class="form-label text-muted small mb-1">Access Role</label>
|
||||
<div class="fw-semibold">{{ user.role }}</div>
|
||||
</div>
|
||||
<div class="col-sm-6">
|
||||
<label class="form-label text-muted small mb-1">Last Login</label>
|
||||
<div class="fw-semibold">
|
||||
{% if user.last_login %}
|
||||
{{ user.last_login }}
|
||||
{% else %}
|
||||
<span class="text-muted">First login</span>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-6">
|
||||
<label class="form-label text-muted small mb-1">Registration Date</label>
|
||||
<div class="fw-semibold">
|
||||
{% if user.created_at %}
|
||||
{{ user.created_at }}
|
||||
{% else %}
|
||||
<span class="text-muted">-</span>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<hr class="my-4">
|
||||
|
||||
<!-- Preferences Section -->
|
||||
<form method="POST" action="/auth/profile">
|
||||
<h5 class="fw-bold mb-3">
|
||||
<i class="bi bi-sliders text-primary me-2"></i>User Preferences
|
||||
</h5>
|
||||
|
||||
<div class="row g-3">
|
||||
<!-- Preferred Language -->
|
||||
<div class="col-md-6 mb-3">
|
||||
<label for="preferred_language" class="form-label fw-semibold">
|
||||
<i class="bi bi-translate text-primary me-1"></i>Interface Language
|
||||
</label>
|
||||
<select class="form-select" id="preferred_language" name="preferred_language">
|
||||
<option value="" {% if not user.preferred_language %}selected{% endif %}>
|
||||
Auto-detect from browser (Default)
|
||||
</option>
|
||||
<option value="es" {% if user.preferred_language == 'es' %}selected{% endif %}>
|
||||
Español
|
||||
</option>
|
||||
<option value="en" {% if user.preferred_language == 'en' %}selected{% endif %}>
|
||||
English
|
||||
</option>
|
||||
</select>
|
||||
<small class="text-muted d-block mt-1">
|
||||
If set, this language overrides the browser configuration for all your sessions.
|
||||
</small>
|
||||
</div>
|
||||
|
||||
<!-- Theme Preference -->
|
||||
<div class="col-md-6 mb-3">
|
||||
<label for="theme_preference" class="form-label fw-semibold">
|
||||
<i class="bi bi-palette text-primary me-1"></i>Visual Theme
|
||||
</label>
|
||||
<select class="form-select" id="theme_preference" name="theme_preference">
|
||||
<option value="auto" {% if user.theme_preference == 'auto' or not user.theme_preference %}selected{% endif %}>
|
||||
Automatic (follow system)
|
||||
</option>
|
||||
<option value="light" {% if user.theme_preference == 'light' %}selected{% endif %}>
|
||||
Light Mode
|
||||
</option>
|
||||
<option value="dark" {% if user.theme_preference == 'dark' %}selected{% endif %}>
|
||||
Dark Mode
|
||||
</option>
|
||||
</select>
|
||||
<small class="text-muted d-block mt-1">
|
||||
Choose your preferred visual theme.
|
||||
</small>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="text-end mt-2">
|
||||
<button type="submit" class="btn btn-primary">
|
||||
<i class="bi bi-check-lg me-1"></i>Save Preferences
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<div class="card-footer bg-body-tertiary px-4 py-3 d-flex justify-content-between align-items-center">
|
||||
<span class="text-muted small">Account Security</span>
|
||||
<a href="/auth/change_password" class="btn btn-primary btn-sm">
|
||||
<i class="bi bi-key me-1"></i>Change Password
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- User Reservations Overview (if any) -->
|
||||
{% if user.reservations %}
|
||||
<div class="card border-0 shadow-sm mb-4">
|
||||
<div class="card-header bg-body-tertiary">
|
||||
<h5 class="card-title mb-0 h6">
|
||||
<i class="bi bi-calendar-event me-2"></i>My Recent Reservations
|
||||
</h5>
|
||||
</div>
|
||||
<div class="card-body p-0">
|
||||
<div class="table-responsive">
|
||||
<table class="table table-hover align-middle mb-0">
|
||||
<thead class="table-light">
|
||||
<tr>
|
||||
<th>Classroom</th>
|
||||
<th>Purpose</th>
|
||||
<th>Date & Time</th>
|
||||
<th>Status</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for res in (user.reservations or []).slice(0, 5) %}
|
||||
<tr>
|
||||
<td>
|
||||
<span class="badge bg-secondary">{{ res.classroom.code_display if res.classroom else 'N/A' }}</span>
|
||||
</td>
|
||||
<td>{{ res.purpose }}</td>
|
||||
<td>{{ res.start_time }}</td>
|
||||
<td>
|
||||
<span class="badge bg-{{ 'success' if res.status == 'CONFIRMED' else ('warning' if res.status == 'PENDING' else 'secondary') }}">
|
||||
{{ res.status }}
|
||||
</span>
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
Reference in New Issue
Block a user