Improving navigation settings and tutorials descriptions
Browse files- app/main.py +27 -0
- app/templates/asistencia.html +6 -2
- app/templates/guia_asistencia.html +35 -0
- app/templates/guia_gestion.html +32 -0
- app/templates/guia_herramientas.html +34 -0
- app/templates/guia_registro.html +35 -0
- app/templates/tutoria.html +14 -5
app/main.py
CHANGED
|
@@ -43,6 +43,17 @@ app = Flask(__name__)
|
|
| 43 |
app.config['SECRET_KEY'] = os.getenv("SECRET_KEY", "maker-secret-key")
|
| 44 |
socketio = SocketIO(app, cors_allowed_origins="*")
|
| 45 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 46 |
# --- GESTIÓN DE USUARIOS (Flask-Login) ---
|
| 47 |
login_manager = LoginManager()
|
| 48 |
login_manager.init_app(app)
|
|
@@ -701,6 +712,22 @@ def asistencia():
|
|
| 701 |
def tutoria():
|
| 702 |
return render_template('tutoria.html', title="Tutoría y Guías")
|
| 703 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 704 |
@app.route('/api/faces', methods=['GET', 'POST'])
|
| 705 |
def api_faces():
|
| 706 |
if request.method == 'POST':
|
|
|
|
| 43 |
app.config['SECRET_KEY'] = os.getenv("SECRET_KEY", "maker-secret-key")
|
| 44 |
socketio = SocketIO(app, cors_allowed_origins="*")
|
| 45 |
|
| 46 |
+
# DEBUG: Verificar si los modelos existen
|
| 47 |
+
try:
|
| 48 |
+
model_path = os.path.join(app.root_path, 'static', 'models')
|
| 49 |
+
if os.path.exists(model_path):
|
| 50 |
+
print(f"[DEBUG] Models directory found at: {model_path}")
|
| 51 |
+
print(f"[DEBUG] Files: {os.listdir(model_path)}")
|
| 52 |
+
else:
|
| 53 |
+
print(f"[DEBUG] ERROR: Models directory NOT found at {model_path}")
|
| 54 |
+
except Exception as e:
|
| 55 |
+
print(f"[DEBUG] Error checking models: {e}")
|
| 56 |
+
|
| 57 |
# --- GESTIÓN DE USUARIOS (Flask-Login) ---
|
| 58 |
login_manager = LoginManager()
|
| 59 |
login_manager.init_app(app)
|
|
|
|
| 712 |
def tutoria():
|
| 713 |
return render_template('tutoria.html', title="Tutoría y Guías")
|
| 714 |
|
| 715 |
+
@app.route('/guia/registro')
|
| 716 |
+
def guia_registro():
|
| 717 |
+
return render_template('guia_registro.html', title="Guía de Registro")
|
| 718 |
+
|
| 719 |
+
@app.route('/guia/herramientas')
|
| 720 |
+
def guia_herramientas():
|
| 721 |
+
return render_template('guia_herramientas.html', title="Guía de Herramientas")
|
| 722 |
+
|
| 723 |
+
@app.route('/guia/asistencia')
|
| 724 |
+
def guia_asistencia():
|
| 725 |
+
return render_template('guia_asistencia.html', title="Guía de Asistencia")
|
| 726 |
+
|
| 727 |
+
@app.route('/guia/gestion')
|
| 728 |
+
def guia_gestion():
|
| 729 |
+
return render_template('guia_gestion.html', title="Guía de Gestión")
|
| 730 |
+
|
| 731 |
@app.route('/api/faces', methods=['GET', 'POST'])
|
| 732 |
def api_faces():
|
| 733 |
if request.method == 'POST':
|
app/templates/asistencia.html
CHANGED
|
@@ -64,7 +64,10 @@
|
|
| 64 |
async function init() {
|
| 65 |
try {
|
| 66 |
// Usar modelos locales con path dinámico de Flask
|
| 67 |
-
|
|
|
|
|
|
|
|
|
|
| 68 |
await Promise.all([
|
| 69 |
faceapi.nets.tinyFaceDetector.loadFromUri(MODEL_URL),
|
| 70 |
faceapi.nets.faceLandmark68Net.loadFromUri(MODEL_URL),
|
|
@@ -75,7 +78,8 @@
|
|
| 75 |
startVideo();
|
| 76 |
} catch (err) {
|
| 77 |
console.error("Error inicializando Face API:", err);
|
| 78 |
-
|
|
|
|
| 79 |
}
|
| 80 |
}
|
| 81 |
|
|
|
|
| 64 |
async function init() {
|
| 65 |
try {
|
| 66 |
// Usar modelos locales con path dinámico de Flask
|
| 67 |
+
// Forzar slash final para que no concatene mal (ej: ...modelsmanifest.json)
|
| 68 |
+
const MODEL_URL = "{{ url_for('static', filename='models') }}" + "/";
|
| 69 |
+
console.log("Loading models from:", MODEL_URL);
|
| 70 |
+
|
| 71 |
await Promise.all([
|
| 72 |
faceapi.nets.tinyFaceDetector.loadFromUri(MODEL_URL),
|
| 73 |
faceapi.nets.faceLandmark68Net.loadFromUri(MODEL_URL),
|
|
|
|
| 78 |
startVideo();
|
| 79 |
} catch (err) {
|
| 80 |
console.error("Error inicializando Face API:", err);
|
| 81 |
+
// Mostrar error detallado para depuración
|
| 82 |
+
alert("Error cargando modelos de IA: " + err.message + "\nRuta intentada: " + "{{ url_for('static', filename='models') }}");
|
| 83 |
}
|
| 84 |
}
|
| 85 |
|
app/templates/guia_asistencia.html
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{% extends "base.html" %}
|
| 2 |
+
|
| 3 |
+
{% block content %}
|
| 4 |
+
<div class="hero section">
|
| 5 |
+
<h1>ASISTENCIA CON IA</h1>
|
| 6 |
+
<p class="text-dim">Registro automático mediante reconocimiento facial.</p>
|
| 7 |
+
</div>
|
| 8 |
+
|
| 9 |
+
<div class="glass" style="padding: 2rem; border-radius: 1rem; max-width: 800px; margin: 0 auto;">
|
| 10 |
+
<div style="margin-bottom: 2rem;">
|
| 11 |
+
<h2>1. Registro de Rostro (Primera vez)</h2>
|
| 12 |
+
<p> Antes de usar el sistema, la IA debe aprender a reconocerte.</p>
|
| 13 |
+
<ol style="margin-left: 1.5rem; margin-top: 1rem; color: var(--text-dim);">
|
| 14 |
+
<li>Ve al apartado de <strong>Asistencia</strong>.</li>
|
| 15 |
+
<li>Selecciona la opción <strong>REGISTRAR ROSTRO</strong>.</li>
|
| 16 |
+
<li>Escribe tu nombre completo.</li>
|
| 17 |
+
<li>Mira a la cámara hasta que el recuadro te detecte y pulsa "GUARDAR".</li>
|
| 18 |
+
</ol>
|
| 19 |
+
</div>
|
| 20 |
+
|
| 21 |
+
<div style="margin-bottom: 2rem;">
|
| 22 |
+
<h2>2. Marcar Asistencia Diaria</h2>
|
| 23 |
+
<p>Simplemente entra al modo asistencia.</p>
|
| 24 |
+
<ul style="margin-left: 1.5rem; margin-top: 1rem; color: var(--text-dim);">
|
| 25 |
+
<li>La cámara detectará tu rostro y mostrará tu nombre.</li>
|
| 26 |
+
<li>El sistema registrará tu entrada automáticamente (una vez cada 30 segundos máximo).</li>
|
| 27 |
+
<li>Recibirás una confirmación visual en pantalla.</li>
|
| 28 |
+
</ul>
|
| 29 |
+
</div>
|
| 30 |
+
|
| 31 |
+
<button onclick="window.location.href='/tutoria'" class="btn glass">
|
| 32 |
+
<i class="fas fa-arrow-left"></i> Volver a Tutorías
|
| 33 |
+
</button>
|
| 34 |
+
</div>
|
| 35 |
+
{% endblock %}
|
app/templates/guia_gestion.html
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{% extends "base.html" %}
|
| 2 |
+
|
| 3 |
+
{% block content %}
|
| 4 |
+
<div class="hero section">
|
| 5 |
+
<h1>GESTIÓN DE PRÉSTAMOS</h1>
|
| 6 |
+
<p class="text-dim">Guía para maestros y administradores del Maker Space.</p>
|
| 7 |
+
</div>
|
| 8 |
+
|
| 9 |
+
<div class="glass" style="padding: 2rem; border-radius: 1rem; max-width: 800px; margin: 0 auto;">
|
| 10 |
+
<div style="margin-bottom: 2rem;">
|
| 11 |
+
<h2>1. Recepción de Solicitudes</h2>
|
| 12 |
+
<p>Las solicitudes de los alumnos llegan por dos vías:</p>
|
| 13 |
+
<ul style="margin-left: 1.5rem; margin-top: 1rem; color: var(--text-dim);">
|
| 14 |
+
<li><strong>Telegram:</strong> Recibirás un mensaje con los detalles y botones para Aceptar/Rechazar.</li>
|
| 15 |
+
<li><strong>Panel Web:</strong> En la sección de Préstamos verás la lista de solicitudes pendientes.</li>
|
| 16 |
+
</ul>
|
| 17 |
+
</div>
|
| 18 |
+
|
| 19 |
+
<div style="margin-bottom: 2rem;">
|
| 20 |
+
<h2>2. Proceso de Aprobación</h2>
|
| 21 |
+
<ol style="margin-left: 1.5rem; margin-top: 1rem; color: var(--text-dim);">
|
| 22 |
+
<li>Revisa la disponibilidad del material solicitado.</li>
|
| 23 |
+
<li>Si todo está correcto, pulsa <strong>Aceptar</strong>. El alumno será notificado.</li>
|
| 24 |
+
<li>Cuando el alumno devuelva el material, marca la solicitud como <strong>ENTREGADO</strong>.</li>
|
| 25 |
+
</ol>
|
| 26 |
+
</div>
|
| 27 |
+
|
| 28 |
+
<button onclick="window.location.href='/tutoria'" class="btn glass">
|
| 29 |
+
<i class="fas fa-arrow-left"></i> Volver a Tutorías
|
| 30 |
+
</button>
|
| 31 |
+
</div>
|
| 32 |
+
{% endblock %}
|
app/templates/guia_herramientas.html
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{% extends "base.html" %}
|
| 2 |
+
|
| 3 |
+
{% block content %}
|
| 4 |
+
<div class="hero section">
|
| 5 |
+
<h1>SOLICITUD DE HERRAMIENTAS</h1>
|
| 6 |
+
<p class="text-dim">Cómo pedir prestado equipo del inventario.</p>
|
| 7 |
+
</div>
|
| 8 |
+
|
| 9 |
+
<div class="glass" style="padding: 2rem; border-radius: 1rem; max-width: 800px; margin: 0 auto;">
|
| 10 |
+
<div style="margin-bottom: 2rem;">
|
| 11 |
+
<h2>1. Realizar una Solicitud</h2>
|
| 12 |
+
<p>Desde la sección de <strong>Préstamos</strong> puedes ver el catálogo disponible.</p>
|
| 13 |
+
<ol style="margin-left: 1.5rem; margin-top: 1rem; color: var(--text-dim);">
|
| 14 |
+
<li>Selecciona las herramientas que necesitas (Arduino, Impresora 3D, Herremientas manuales, etc.).</li>
|
| 15 |
+
<li>Define la <strong>Hora de Salida</strong> y <strong>Hora de Retorno</strong> estimada.</li>
|
| 16 |
+
<li>Envía la solicitud. Esta llegará inmediatamente al grupo de Telegram de los maestros.</li>
|
| 17 |
+
</ol>
|
| 18 |
+
</div>
|
| 19 |
+
|
| 20 |
+
<div style="margin-bottom: 2rem;">
|
| 21 |
+
<h2>2. Aprobación y Entrega</h2>
|
| 22 |
+
<p>Espera a que un maestro apruebe tu solicitud.</p>
|
| 23 |
+
<ul style="margin-left: 1.5rem; margin-top: 1rem; color: var(--text-dim);">
|
| 24 |
+
<li>Verás el estado de tu préstamo cambiar a <span style="color:#10b981">ACEPTADO</span>.</li>
|
| 25 |
+
<li>Acércate al encargado para recibir el material.</li>
|
| 26 |
+
<li>Al terminar, asegúrate de devolver todo en el mismo estado.</li>
|
| 27 |
+
</ul>
|
| 28 |
+
</div>
|
| 29 |
+
|
| 30 |
+
<button onclick="window.location.href='/tutoria'" class="btn glass">
|
| 31 |
+
<i class="fas fa-arrow-left"></i> Volver a Tutorías
|
| 32 |
+
</button>
|
| 33 |
+
</div>
|
| 34 |
+
{% endblock %}
|
app/templates/guia_registro.html
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{% extends "base.html" %}
|
| 2 |
+
|
| 3 |
+
{% block content %}
|
| 4 |
+
<div class="hero section">
|
| 5 |
+
<h1>PRIMEROS PASOS</h1>
|
| 6 |
+
<p class="text-dim">Guía básica para nuevos miembros del Maker Space.</p>
|
| 7 |
+
</div>
|
| 8 |
+
|
| 9 |
+
<div class="glass" style="padding: 2rem; border-radius: 1rem; max-width: 800px; margin: 0 auto;">
|
| 10 |
+
<div style="margin-bottom: 2rem;">
|
| 11 |
+
<h2>1. Registro en la Plataforma</h2>
|
| 12 |
+
<p>Para acceder a las herramientas y registrar tu asistencia, necesitas una cuenta activa.</p>
|
| 13 |
+
<ol style="margin-left: 1.5rem; margin-top: 1rem; color: var(--text-dim);">
|
| 14 |
+
<li>Ve a la página de <strong>Login</strong> y selecciona "Registrarse".</li>
|
| 15 |
+
<li>Ingresa tu nombre completo y un correo electrónico válido.</li>
|
| 16 |
+
<li>Tu cuenta quedará en estado <strong>Pendiente</strong> hasta que un maestro la apruebe.</li>
|
| 17 |
+
<li>Recibirás una notificación (o podrás intentar entrar) una vez seas aprobado.</li>
|
| 18 |
+
</ol>
|
| 19 |
+
</div>
|
| 20 |
+
|
| 21 |
+
<div style="margin-bottom: 2rem;">
|
| 22 |
+
<h2>2. Normas del Espacio</h2>
|
| 23 |
+
<p>El Maker Space es un lugar de colaboración y respeto.</p>
|
| 24 |
+
<ul style="margin-left: 1.5rem; margin-top: 1rem; color: var(--text-dim);">
|
| 25 |
+
<li>Mantén el área limpia y ordenada.</li>
|
| 26 |
+
<li>Pide ayuda si no sabes usar una herramienta.</li>
|
| 27 |
+
<li>Registra siempre tu asistencia al entrar.</li>
|
| 28 |
+
</ul>
|
| 29 |
+
</div>
|
| 30 |
+
|
| 31 |
+
<button onclick="window.location.href='/tutoria'" class="btn glass">
|
| 32 |
+
<i class="fas fa-arrow-left"></i> Volver a Tutorías
|
| 33 |
+
</button>
|
| 34 |
+
</div>
|
| 35 |
+
{% endblock %}
|
app/templates/tutoria.html
CHANGED
|
@@ -26,22 +26,28 @@
|
|
| 26 |
<h3>🚀 Primeros Pasos</h3>
|
| 27 |
<p class="text-dim">Cómo registrarte y acceder al espacio.</p>
|
| 28 |
</div>
|
| 29 |
-
<button class="btn glass">Ver Guía</button>
|
| 30 |
</li>
|
| 31 |
<li class="repo-item glass">
|
| 32 |
<div style="flex: 1;">
|
| 33 |
<h3>🛠 Solicitud de Herramientas</h3>
|
| 34 |
<p class="text-dim">Proceso para pedir prestada una herramienta.</p>
|
| 35 |
</div>
|
| 36 |
-
<
|
|
|
|
|
|
|
|
|
|
| 37 |
</li>
|
| 38 |
<li class="repo-item glass">
|
| 39 |
<div style="flex: 1;">
|
| 40 |
<h3>🤖 Asistencia (IA)</h3>
|
| 41 |
<p class="text-dim">Registra tu asistencia usando reconocimiento facial.</p>
|
| 42 |
</div>
|
| 43 |
-
<
|
| 44 |
-
|
|
|
|
|
|
|
|
|
|
| 45 |
</li>
|
| 46 |
</ul>
|
| 47 |
</div>
|
|
@@ -53,7 +59,10 @@
|
|
| 53 |
<h3>📦 Aprobación de Préstamos</h3>
|
| 54 |
<p class="text-dim">Administrar solicitudes de equipo de los miembros.</p>
|
| 55 |
</div>
|
| 56 |
-
<
|
|
|
|
|
|
|
|
|
|
| 57 |
</li>
|
| 58 |
</ul>
|
| 59 |
</div>
|
|
|
|
| 26 |
<h3>🚀 Primeros Pasos</h3>
|
| 27 |
<p class="text-dim">Cómo registrarte y acceder al espacio.</p>
|
| 28 |
</div>
|
| 29 |
+
<button onclick="window.location.href='/guia/registro'" class="btn glass">Ver Guía</button>
|
| 30 |
</li>
|
| 31 |
<li class="repo-item glass">
|
| 32 |
<div style="flex: 1;">
|
| 33 |
<h3>🛠 Solicitud de Herramientas</h3>
|
| 34 |
<p class="text-dim">Proceso para pedir prestada una herramienta.</p>
|
| 35 |
</div>
|
| 36 |
+
<div style="display: flex; gap: 0.5rem;">
|
| 37 |
+
<button onclick="window.location.href='/guia/herramientas'" class="btn glass">Guía</button>
|
| 38 |
+
<button onclick="window.location.href='/prestamos'" class="btn glass">Ir a Préstamos</button>
|
| 39 |
+
</div>
|
| 40 |
</li>
|
| 41 |
<li class="repo-item glass">
|
| 42 |
<div style="flex: 1;">
|
| 43 |
<h3>🤖 Asistencia (IA)</h3>
|
| 44 |
<p class="text-dim">Registra tu asistencia usando reconocimiento facial.</p>
|
| 45 |
</div>
|
| 46 |
+
<div style="display: flex; gap: 0.5rem;">
|
| 47 |
+
<button onclick="window.location.href='/guia/asistencia'" class="btn glass">Guía</button>
|
| 48 |
+
<button onclick="window.location.href='/asistencia'" class="btn glass"
|
| 49 |
+
style="background: rgba(16, 185, 129, 0.2); border-color: #10b981;">Registrar</button>
|
| 50 |
+
</div>
|
| 51 |
</li>
|
| 52 |
</ul>
|
| 53 |
</div>
|
|
|
|
| 59 |
<h3>📦 Aprobación de Préstamos</h3>
|
| 60 |
<p class="text-dim">Administrar solicitudes de equipo de los miembros.</p>
|
| 61 |
</div>
|
| 62 |
+
<div style="display: flex; gap: 0.5rem;">
|
| 63 |
+
<button onclick="window.location.href='/guia/gestion'" class="btn glass">Guía</button>
|
| 64 |
+
<button onclick="window.location.href='/prestamos'" class="btn glass">Administrar</button>
|
| 65 |
+
</div>
|
| 66 |
</li>
|
| 67 |
</ul>
|
| 68 |
</div>
|