Spaces:
Sleeping
Sleeping
Merge pull request #2 from CascoArcilla/HU6
Browse filesDetalles de una sesión sensorial. Refactorización de views
- tecnicas/controllers/__init__.py +2 -0
- tecnicas/controllers/calificacion_controller.py +19 -0
- tecnicas/controllers/detalles_sesion_controller.py +46 -0
- tecnicas/controllers/palabras_controller.py +7 -1
- tecnicas/controllers/sesion_controller.py +43 -0
- tecnicas/static/img/basura.svg +17 -0
- tecnicas/static/img/giro.svg +2 -0
- tecnicas/static/js/details-session.js +26 -0
- tecnicas/templates/tecnicas/main-panel.html +1 -1
- tecnicas/templates/tecnicas/manage_sesions/detalles-sesion.html +186 -0
- tecnicas/templates/tecnicas/manage_sesions/sesiones-panel.html +20 -22
- tecnicas/urls.py +70 -15
- tecnicas/views/__init__.py +17 -12
- tecnicas/views/{api_tag.py → apis/api_tag.py} +3 -3
- tecnicas/views/{api_words.py → apis/api_words.py} +3 -3
- tecnicas/views/{configuration_panel_basic.py → sessions_config/configuration_panel_basic.py} +2 -2
- tecnicas/views/{configuration_panel_codes.py → sessions_config/configuration_panel_codes.py} +2 -2
- tecnicas/views/{configuration_panel_tags.py → sessions_config/configuration_panel_tags.py} +2 -2
- tecnicas/views/{configuration_panel_words.py → sessions_config/configuration_panel_words.py} +2 -2
- tecnicas/views/{create_session.py → sessions_config/create_session.py} +3 -3
- tecnicas/views/{seleccion_tecnica.py → sessions_config/seleccion_tecnica.py} +1 -1
- tecnicas/views/sessions_management/session_details.py +27 -0
- tecnicas/views/sessions_management/sessions_panel.py +25 -0
- tecnicas/views/sessions_panel.py +0 -19
- tecnicas/views/{tester_create.py → tester_management/tester_create.py} +1 -1
- tecnicas/views/{management_catadores.py → tester_management/tester_menu.py} +1 -1
- tecnicas/views/{tester_search.py → tester_management/tester_search.py} +2 -2
tecnicas/controllers/__init__.py
CHANGED
|
@@ -6,3 +6,5 @@ from .palabras_controller import PalabrasController
|
|
| 6 |
from .estilo_palabras_controller import EstiloPalabrasController
|
| 7 |
from .palabras_controller import PalabrasController
|
| 8 |
from .sesion_controller import SesionController
|
|
|
|
|
|
|
|
|
| 6 |
from .estilo_palabras_controller import EstiloPalabrasController
|
| 7 |
from .palabras_controller import PalabrasController
|
| 8 |
from .sesion_controller import SesionController
|
| 9 |
+
from .calificacion_controller import CalificacionController
|
| 10 |
+
from .detalles_sesion_controller import DetallesSesionController
|
tecnicas/controllers/calificacion_controller.py
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from ..models import Calificacion, Tecnica
|
| 2 |
+
|
| 3 |
+
|
| 4 |
+
class CalificacionController():
|
| 5 |
+
@staticmethod
|
| 6 |
+
def getRatingsByTechnique(technique: Tecnica):
|
| 7 |
+
repetition = technique.repecion
|
| 8 |
+
|
| 9 |
+
if not repetition:
|
| 10 |
+
return {"error": "sin datos calficados aun"}
|
| 11 |
+
|
| 12 |
+
data_rating = {}
|
| 13 |
+
|
| 14 |
+
for i in range(repetition):
|
| 15 |
+
response_data = Calificacion.objects.filter(
|
| 16 |
+
id_tecnica=technique, num_repeticion=i+1)
|
| 17 |
+
data_rating[f"repeticion_{i+1}"] = response_data
|
| 18 |
+
|
| 19 |
+
return data_rating
|
tecnicas/controllers/detalles_sesion_controller.py
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from ..models import SesionSensorial, Presentador
|
| 2 |
+
from . import CalificacionController, PalabrasController
|
| 3 |
+
from ..utils import controller_error
|
| 4 |
+
|
| 5 |
+
|
| 6 |
+
class DetallesSesionController():
|
| 7 |
+
@staticmethod
|
| 8 |
+
def getContextForView(session_code: str):
|
| 9 |
+
context = {}
|
| 10 |
+
|
| 11 |
+
session = SesionSensorial.objects.get(codigo_sesion=session_code)
|
| 12 |
+
context["sesion"] = session
|
| 13 |
+
|
| 14 |
+
words = PalabrasController.getWordsInTechnique(session.tecnica)
|
| 15 |
+
context["palabras"] = words
|
| 16 |
+
|
| 17 |
+
rating = CalificacionController.getRatingsByTechnique(
|
| 18 |
+
technique=session.tecnica)
|
| 19 |
+
context["calificaciones"] = rating
|
| 20 |
+
|
| 21 |
+
return context
|
| 22 |
+
|
| 23 |
+
@staticmethod
|
| 24 |
+
def startRepetition(session_code: str, username: str):
|
| 25 |
+
try:
|
| 26 |
+
creator = Presentador.objects.get(nombre_usuario=username)
|
| 27 |
+
session = SesionSensorial.objects.get(codigo_sesion=session_code)
|
| 28 |
+
except Presentador.DoesNotExist:
|
| 29 |
+
return controller_error("no existe presentador")
|
| 30 |
+
except SesionSensorial.DoesNotExist:
|
| 31 |
+
return controller_error("no existe sesión sensorial")
|
| 32 |
+
|
| 33 |
+
if creator.nombre_usuario != session.creadoPor.nombre_usuario:
|
| 34 |
+
return controller_error("solo el presentador que crea la sesión puede iniciar la repetición")
|
| 35 |
+
elif session.activo:
|
| 36 |
+
return controller_error("la sesión ya está activada")
|
| 37 |
+
elif session.tecnica.repecion == session.tecnica.repeticiones_max:
|
| 38 |
+
return controller_error("se ha alcanzado el número de repeticiones máxima")
|
| 39 |
+
|
| 40 |
+
session.activo = True
|
| 41 |
+
rep = session.tecnica.repecion
|
| 42 |
+
session.tecnica.repecion = rep + 1
|
| 43 |
+
|
| 44 |
+
session.save()
|
| 45 |
+
|
| 46 |
+
return session
|
tecnicas/controllers/palabras_controller.py
CHANGED
|
@@ -1,4 +1,4 @@
|
|
| 1 |
-
from ..models import Palabra
|
| 2 |
from django.db import DatabaseError
|
| 3 |
from ..utils import controller_error
|
| 4 |
|
|
@@ -23,3 +23,9 @@ class PalabrasController():
|
|
| 23 |
return self.words
|
| 24 |
except DatabaseError as error:
|
| 25 |
return controller_error("error al guardar buscar palabras")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from ..models import Palabra, Tecnica, EsAtributo
|
| 2 |
from django.db import DatabaseError
|
| 3 |
from ..utils import controller_error
|
| 4 |
|
|
|
|
| 23 |
return self.words
|
| 24 |
except DatabaseError as error:
|
| 25 |
return controller_error("error al guardar buscar palabras")
|
| 26 |
+
|
| 27 |
+
@staticmethod
|
| 28 |
+
def getWordsInTechnique(technique: Tecnica):
|
| 29 |
+
es_atributo = EsAtributo.objects.get(id_tecnica=technique)
|
| 30 |
+
words = es_atributo.palabras.all()
|
| 31 |
+
return words
|
tecnicas/controllers/sesion_controller.py
CHANGED
|
@@ -1,4 +1,5 @@
|
|
| 1 |
from django.db import DatabaseError
|
|
|
|
| 2 |
from ..models import Tecnica, Presentador, SesionSensorial
|
| 3 |
from ..utils import controller_error
|
| 4 |
|
|
@@ -39,3 +40,45 @@ class SesionController():
|
|
| 39 |
return self.sensorial_session
|
| 40 |
except DatabaseError as error:
|
| 41 |
return controller_error("Error al crear la session sensorial")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
from django.db import DatabaseError
|
| 2 |
+
from django.core.paginator import Paginator, EmptyPage, PageNotAnInteger
|
| 3 |
from ..models import Tecnica, Presentador, SesionSensorial
|
| 4 |
from ..utils import controller_error
|
| 5 |
|
|
|
|
| 40 |
return self.sensorial_session
|
| 41 |
except DatabaseError as error:
|
| 42 |
return controller_error("Error al crear la session sensorial")
|
| 43 |
+
|
| 44 |
+
@staticmethod
|
| 45 |
+
def getSessionsSavesByCretor(user_name: str, page: int):
|
| 46 |
+
elements_by_page = 9
|
| 47 |
+
|
| 48 |
+
try:
|
| 49 |
+
creator = Presentador.objects.get(nombre_usuario=user_name)
|
| 50 |
+
except Presentador.DoesNotExist:
|
| 51 |
+
return controller_error("presentador invalido")
|
| 52 |
+
|
| 53 |
+
try:
|
| 54 |
+
queryset = SesionSensorial.objects.select_related(
|
| 55 |
+
"tecnica",
|
| 56 |
+
"tecnica__tipo_tecnica",
|
| 57 |
+
"tecnica__id_estilo").only(
|
| 58 |
+
"codigo_sesion",
|
| 59 |
+
"nombre_sesion",
|
| 60 |
+
"fechaCreacion",
|
| 61 |
+
"tecnica__tipo_tecnica__nombre_tecnica",
|
| 62 |
+
"tecnica__id_estilo__nombre_estilo"
|
| 63 |
+
)
|
| 64 |
+
|
| 65 |
+
paginator = Paginator(queryset, elements_by_page)
|
| 66 |
+
sessions_in_page = paginator.get_page(page)
|
| 67 |
+
except PageNotAnInteger:
|
| 68 |
+
return controller_error("indice invalido")
|
| 69 |
+
except EmptyPage:
|
| 70 |
+
return controller_error("sin registros de sessiones")
|
| 71 |
+
|
| 72 |
+
return sessions_in_page
|
| 73 |
+
|
| 74 |
+
@staticmethod
|
| 75 |
+
def getNumberSessionsByCreator(user_name: str):
|
| 76 |
+
try:
|
| 77 |
+
creator = Presentador.objects.get(nombre_usuario=user_name)
|
| 78 |
+
except Presentador.DoesNotExist:
|
| 79 |
+
return controller_error("presentador invalido")
|
| 80 |
+
|
| 81 |
+
number_sessions = SesionSensorial.objects.filter(
|
| 82 |
+
creadoPor=creator).count()
|
| 83 |
+
|
| 84 |
+
return number_sessions/9
|
tecnicas/static/img/basura.svg
ADDED
|
|
tecnicas/static/img/giro.svg
ADDED
|
|
tecnicas/static/js/details-session.js
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
const actionForm = document.querySelector(".form-action-session");
|
| 2 |
+
const notificationError = document.querySelector(".ct-notification-error");
|
| 3 |
+
|
| 4 |
+
if (notificationError) {
|
| 5 |
+
setTimeout(function () {
|
| 6 |
+
notificationError.classList.add("hidden");
|
| 7 |
+
}, 2000);
|
| 8 |
+
}
|
| 9 |
+
|
| 10 |
+
function startRepetition() {
|
| 11 |
+
const inputAction = document.createElement("input");
|
| 12 |
+
inputAction.type = "hidden";
|
| 13 |
+
inputAction.name = "action";
|
| 14 |
+
inputAction.value = "start_session";
|
| 15 |
+
|
| 16 |
+
const inputUser = document.createElement("input");
|
| 17 |
+
inputUser.type = "hidden";
|
| 18 |
+
inputUser.name = "username";
|
| 19 |
+
inputUser.value = "pollo";
|
| 20 |
+
|
| 21 |
+
actionForm.appendChild(inputAction);
|
| 22 |
+
actionForm.appendChild(inputUser);
|
| 23 |
+
|
| 24 |
+
actionForm.classList.remove("hidden");
|
| 25 |
+
actionForm.submit();
|
| 26 |
+
}
|
tecnicas/templates/tecnicas/main-panel.html
CHANGED
|
@@ -38,7 +38,7 @@
|
|
| 38 |
</section>
|
| 39 |
|
| 40 |
<section class="flex flex-row flex-wrap gap-4 w-f ull justify-center">
|
| 41 |
-
<a href="{% url 'cata_system:panel_sesiones' %}"
|
| 42 |
class="text-white bg-blue-600 hover:bg-blue-700 active:outline-none active:ring-4 active:ring-blue-300 font-medium rounded-xl text-3xl px-8 py-4 text-center uppercase">Gestión
|
| 43 |
de sesiones <br> sensoriales</a>
|
| 44 |
</section>
|
|
|
|
| 38 |
</section>
|
| 39 |
|
| 40 |
<section class="flex flex-row flex-wrap gap-4 w-f ull justify-center">
|
| 41 |
+
<a href="{% url 'cata_system:panel_sesiones' page=1 %}"
|
| 42 |
class="text-white bg-blue-600 hover:bg-blue-700 active:outline-none active:ring-4 active:ring-blue-300 font-medium rounded-xl text-3xl px-8 py-4 text-center uppercase">Gestión
|
| 43 |
de sesiones <br> sensoriales</a>
|
| 44 |
</section>
|
tecnicas/templates/tecnicas/manage_sesions/detalles-sesion.html
ADDED
|
@@ -0,0 +1,186 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{% extends 'tecnicas/layouts/base.html' %}
|
| 2 |
+
{% load static %}
|
| 3 |
+
|
| 4 |
+
{% block title %}Detalles Sesion{% endblock %}
|
| 5 |
+
|
| 6 |
+
{% block content %}
|
| 7 |
+
<article class="w-full flex flex-col justify-center items-center bg-gray-600 mt-10 mb-10">
|
| 8 |
+
<article class="flex flex-col gap-8 bg-gray-400 p-10 rounded-2xl">
|
| 9 |
+
<header class="text-center flex-row w-full flex justify-around items-center flex-wrap gap-10">
|
| 10 |
+
<h1 class="text-white rounded-xl font-bold text-2xl bg-gray-600 p-4 flex-1">
|
| 11 |
+
Detalles de la sesión
|
| 12 |
+
</h1>
|
| 13 |
+
<a href="{% url 'cata_system:index' %}">
|
| 14 |
+
<p
|
| 15 |
+
class="uppercase text-lg tracking-wider font-medium p-2 px-4 border-b-2 active:border-b-0 active:border-t-2 active:border-blue-500 border-blue-800 transition-all rounded-xl bg-blue-600 text-white">
|
| 16 |
+
Panel principal
|
| 17 |
+
</p>
|
| 18 |
+
</a>
|
| 19 |
+
</header>
|
| 20 |
+
|
| 21 |
+
{% if error %}
|
| 22 |
+
<article class="bg-red-600 p-4 text-white rounded-xl ct-notification-error">
|
| 23 |
+
<p class="block font-sans text-white text-xl antialiased font-bold uppercase tracking-wider text-center">
|
| 24 |
+
{{ error }}
|
| 25 |
+
</p>
|
| 26 |
+
</article>
|
| 27 |
+
{% endif %}
|
| 28 |
+
|
| 29 |
+
<p class="font-bold text-2xl border-b-2">
|
| 30 |
+
Información general
|
| 31 |
+
</p>
|
| 32 |
+
<article
|
| 33 |
+
class="text-white rounded-xl grid grid-cols-2 max-sm:grid-cols-1 gap-3 *:bg-gray-500 *:flex *:flex-wrap *:items-center *:justify-center *:max-sm:justify-normal *:gap-x-2 *:p-4 *:rounded-2xl">
|
| 34 |
+
<section class="col-span-2 max-sm:col-span-1">
|
| 35 |
+
<p class="text-xl font-bold">
|
| 36 |
+
Código:
|
| 37 |
+
</p>
|
| 38 |
+
<p class="font-sans text-xl font-normal">
|
| 39 |
+
{{ sesion.codigo_sesion }}
|
| 40 |
+
</p>
|
| 41 |
+
</section>
|
| 42 |
+
|
| 43 |
+
<section class="col-span-2 max-sm:col-span-1">
|
| 44 |
+
<p class="text-xl font-bold">
|
| 45 |
+
Nombre:
|
| 46 |
+
</p>
|
| 47 |
+
<p class="text-xl antialiased">
|
| 48 |
+
{% if sesion.nombre_sesion %}
|
| 49 |
+
{{ sesion.nombre_sesion }}
|
| 50 |
+
{% else %}
|
| 51 |
+
Sin nombre
|
| 52 |
+
{% endif %}
|
| 53 |
+
</p>
|
| 54 |
+
</section>
|
| 55 |
+
|
| 56 |
+
<section>
|
| 57 |
+
<p class="text-xl font-medium">
|
| 58 |
+
Fecha creación:
|
| 59 |
+
</p>
|
| 60 |
+
<p class="font-sans text-lg font-normal uppercase">
|
| 61 |
+
{{ sesion.fechaCreacion }}
|
| 62 |
+
</p>
|
| 63 |
+
</section>
|
| 64 |
+
|
| 65 |
+
<section>
|
| 66 |
+
<p class="text-lg font-bold">
|
| 67 |
+
Estado:
|
| 68 |
+
</p>
|
| 69 |
+
<p class="font-sans text-lg font-normal">
|
| 70 |
+
{% if sesion.activo %}
|
| 71 |
+
En proceso
|
| 72 |
+
{% else %}
|
| 73 |
+
Listo para iniciar repetición
|
| 74 |
+
{% endif %}
|
| 75 |
+
</p>
|
| 76 |
+
</section>
|
| 77 |
+
|
| 78 |
+
<section>
|
| 79 |
+
<p class="text-xl font-medium">
|
| 80 |
+
Estilo palabras:
|
| 81 |
+
</p>
|
| 82 |
+
<p class="font-sans text-lg font-normal uppercase">
|
| 83 |
+
{{ sesion.tecnica.id_estilo }}
|
| 84 |
+
</p>
|
| 85 |
+
</section>
|
| 86 |
+
|
| 87 |
+
<section>
|
| 88 |
+
<p class="text-xl font-medium">
|
| 89 |
+
Técnica:
|
| 90 |
+
</p>
|
| 91 |
+
<p class="font-sans text-lg font-normal uppercase">
|
| 92 |
+
{{ sesion.tecnica.tipo_tecnica }}
|
| 93 |
+
</p>
|
| 94 |
+
</section>
|
| 95 |
+
|
| 96 |
+
<section>
|
| 97 |
+
<p class="text-xl font-medium">
|
| 98 |
+
Rep. Hechas:
|
| 99 |
+
</p>
|
| 100 |
+
<p class="font-sans text-lg font-normal">
|
| 101 |
+
{{ sesion.tecnica.repecion }}
|
| 102 |
+
</p>
|
| 103 |
+
</section>
|
| 104 |
+
|
| 105 |
+
<section>
|
| 106 |
+
<p class="text-xl font-medium">
|
| 107 |
+
Rep. Max:
|
| 108 |
+
</p>
|
| 109 |
+
<p class="font-sans text-lg font-normal">
|
| 110 |
+
{{ sesion.tecnica.repeticiones_max }}
|
| 111 |
+
</p>
|
| 112 |
+
</section>
|
| 113 |
+
|
| 114 |
+
<section class="col-span-2 max-sm:col-span-1">
|
| 115 |
+
<p class="text-xl font-bold">
|
| 116 |
+
Instrucciones:
|
| 117 |
+
</p>
|
| 118 |
+
<p class="font-sans text-xl font-normal">
|
| 119 |
+
{{ sesion.tecnica.instrucciones }}
|
| 120 |
+
</p>
|
| 121 |
+
</section>
|
| 122 |
+
</article>
|
| 123 |
+
|
| 124 |
+
<p class="font-bold text-2xl border-b-2">
|
| 125 |
+
Palabras usadas para calificar
|
| 126 |
+
</p>
|
| 127 |
+
<article
|
| 128 |
+
class="text-white rounded-xl grid grid-cols-4 max-sm:grid-cols-1 gap-3 *:bg-gray-500 *:flex *:items-center *:justify-center *:gap-x-2 *:p-4 *:rounded-2xl">
|
| 129 |
+
{% for palabra in palabras %}
|
| 130 |
+
<section>
|
| 131 |
+
<p class="block text-xl antialiased font-medium">
|
| 132 |
+
{{ palabra.nombre_palabra }}
|
| 133 |
+
</p>
|
| 134 |
+
</section>
|
| 135 |
+
{% endfor %}
|
| 136 |
+
</article>
|
| 137 |
+
|
| 138 |
+
|
| 139 |
+
<p class="font-bold text-2xl border-b-2">
|
| 140 |
+
Acciones disponibles
|
| 141 |
+
</p>
|
| 142 |
+
<article class="flex flex-wrap gap-10">
|
| 143 |
+
{% if not sesion.activo %}
|
| 144 |
+
<button
|
| 145 |
+
class="ct-btn-start-repition flex-1 uppercase text-lg tracking-wider p-4 border-b-2 active:border-b-0 active:border-t-2 active:border-green-500 border-green-800 transition-all rounded-xl bg-green-600 text-white font-bold disabled:bg-amber-600 flex flex-col justify-center items-center gap-2"
|
| 146 |
+
onclick="startRepetition()">
|
| 147 |
+
Iniciar repetición
|
| 148 |
+
<figure class="w-10">
|
| 149 |
+
<img src="{% static 'img/giro.svg' %}" alt="flechas girando" class="invert">
|
| 150 |
+
</figure>
|
| 151 |
+
</button>
|
| 152 |
+
{% endif %}
|
| 153 |
+
|
| 154 |
+
<button
|
| 155 |
+
class="flex-1 uppercase text-lg tracking-wider p-4 border-b-2 active:border-b-0 active:border-t-2 active:border-red-500 border-red-800 transition-all rounded-xl bg-red-600 text-white font-bold disabled:bg-amber-600 flex flex-col justify-center items-center gap-2">
|
| 156 |
+
borrar
|
| 157 |
+
<figure class="w-10">
|
| 158 |
+
<img src="{% static 'img/basura.svg' %}" alt="bote de basura" class="invert">
|
| 159 |
+
</figure>
|
| 160 |
+
</button>
|
| 161 |
+
</article>
|
| 162 |
+
|
| 163 |
+
<p class="font-bold text-2xl border-b-2">
|
| 164 |
+
Datos obtenidos
|
| 165 |
+
</p>
|
| 166 |
+
|
| 167 |
+
{% if calificaciones.error %}
|
| 168 |
+
<article class="bg-gray-600 p-4 text-white rounded-xl">
|
| 169 |
+
<p class="block font-sans text-xl antialiased font-normal uppercase tracking-wider text-center">
|
| 170 |
+
{{ calificaciones.error }}
|
| 171 |
+
</p>
|
| 172 |
+
</article>
|
| 173 |
+
{% else %}
|
| 174 |
+
<article class="bg-gray-600 p-4 text-white rounded-xl">
|
| 175 |
+
</article>
|
| 176 |
+
{% endif %}
|
| 177 |
+
<form action="" method="post" class="form-action-session hidden">
|
| 178 |
+
{% csrf_token %}
|
| 179 |
+
</form>
|
| 180 |
+
</article>
|
| 181 |
+
</article>
|
| 182 |
+
{% endblock %}
|
| 183 |
+
|
| 184 |
+
{% block extra_js %}
|
| 185 |
+
<script src="{% static 'js/details-session.js' %}"></script>
|
| 186 |
+
{% endblock %}
|
tecnicas/templates/tecnicas/manage_sesions/sesiones-panel.html
CHANGED
|
@@ -5,7 +5,7 @@
|
|
| 5 |
|
| 6 |
{% block content %}
|
| 7 |
<article class="w-full flex flex-col justify-center items-center bg-gray-600 mt-10 mb-10">
|
| 8 |
-
<article class="flex flex-col gap-8 bg-gray-400 p-10 rounded-2xl
|
| 9 |
<header class="text-center flex flex-row gap-8 items-center w-full">
|
| 10 |
<div class="bg-gray-600 p-4 text-white rounded-xl flex-1">
|
| 11 |
<h1 class="font-bold text-2xl">Administra las<br>sesiones sensoriales</h1>
|
|
@@ -16,35 +16,33 @@
|
|
| 16 |
principal</a>
|
| 17 |
</div>
|
| 18 |
</header>
|
| 19 |
-
<section class="grid grid-cols-3 gap-4">
|
| 20 |
-
<article class="p-4 bg-gray-200 flex flex-row gap-4 justify-center items-center rounded-lg">
|
| 21 |
-
<div class="text-right *:not-last:mb-4">
|
| 22 |
-
<p><b>Código:</b></p>
|
| 23 |
-
<p><b>Fecha:</b></p>
|
| 24 |
-
<p><b>Técnica:</b></p>
|
| 25 |
-
</div>
|
| 26 |
-
<div class="*:not-last:mb-4">
|
| 27 |
-
<p>9J78GGHJK7V</p>
|
| 28 |
-
<p>12-07-2025</p>
|
| 29 |
-
<p>Intensidad</p>
|
| 30 |
-
</div>
|
| 31 |
-
</article>
|
| 32 |
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 36 |
<p><b>Código:</b></p>
|
| 37 |
<p><b>Fecha:</b></p>
|
| 38 |
<p><b>Técnica:</b></p>
|
|
|
|
| 39 |
</div>
|
| 40 |
-
<div class="*:not-last:mb-
|
| 41 |
-
|
| 42 |
-
<p>{{
|
| 43 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 44 |
</div>
|
| 45 |
-
</
|
| 46 |
{% endfor %}
|
| 47 |
</section>
|
|
|
|
| 48 |
<section class="flex justify-center items-center gap-2">
|
| 49 |
<button>
|
| 50 |
<img class="h-10" src="{% static 'img/less-than.svg' %}" alt="menor que">
|
|
|
|
| 5 |
|
| 6 |
{% block content %}
|
| 7 |
<article class="w-full flex flex-col justify-center items-center bg-gray-600 mt-10 mb-10">
|
| 8 |
+
<article class="flex flex-col gap-8 bg-gray-400 p-10 rounded-2xl">
|
| 9 |
<header class="text-center flex flex-row gap-8 items-center w-full">
|
| 10 |
<div class="bg-gray-600 p-4 text-white rounded-xl flex-1">
|
| 11 |
<h1 class="font-bold text-2xl">Administra las<br>sesiones sensoriales</h1>
|
|
|
|
| 16 |
principal</a>
|
| 17 |
</div>
|
| 18 |
</header>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 19 |
|
| 20 |
+
<section class="grid grid-cols-3 gap-4">
|
| 21 |
+
{% for sesion in sessions %}
|
| 22 |
+
<a href="{% url 'cata_system:detalles_sesion' session_code=sesion.codigo_sesion %}"
|
| 23 |
+
class="p-4 bg-gray-200 flex flex-row gap-2 justify-center items-center rounded-lg border-b-4 border-blue-500">
|
| 24 |
+
<div class="text-right *:not-last:mb-2">
|
| 25 |
+
{% if sesion.nombre_sesion %}
|
| 26 |
+
<p><b>Nombre:</b></p>
|
| 27 |
+
{% endif %}
|
| 28 |
<p><b>Código:</b></p>
|
| 29 |
<p><b>Fecha:</b></p>
|
| 30 |
<p><b>Técnica:</b></p>
|
| 31 |
+
<p><b>Estilo:</b></p>
|
| 32 |
</div>
|
| 33 |
+
<div class="*:not-last:mb-2">
|
| 34 |
+
{% if sesion.nombre_sesion %}
|
| 35 |
+
<p>{{ sesion.nombre_sesion }}</p>
|
| 36 |
+
{% endif %}
|
| 37 |
+
<p>{{ sesion.codigo_sesion }}</p>
|
| 38 |
+
<p>{{ sesion.fechaCreacion }}</p>
|
| 39 |
+
<p class="uppercase">{{ sesion.tecnica.tipo_tecnica.nombre_tecnica }}</p>
|
| 40 |
+
<p class="uppercase">{{ sesion.tecnica.id_estilo.nombre_estilo }}</p>
|
| 41 |
</div>
|
| 42 |
+
</a>
|
| 43 |
{% endfor %}
|
| 44 |
</section>
|
| 45 |
+
|
| 46 |
<section class="flex justify-center items-center gap-2">
|
| 47 |
<button>
|
| 48 |
<img class="h-10" src="{% static 'img/less-than.svg' %}" alt="menor que">
|
tecnicas/urls.py
CHANGED
|
@@ -6,18 +6,73 @@ from . import views
|
|
| 6 |
app_name = "cata_system"
|
| 7 |
urlpatterns = [
|
| 8 |
path("", views.mainPanel, name="index"),
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
path("
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
path("
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
path("
|
| 22 |
-
|
| 23 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 6 |
app_name = "cata_system"
|
| 7 |
urlpatterns = [
|
| 8 |
path("", views.mainPanel, name="index"),
|
| 9 |
+
|
| 10 |
+
# Atentificacion
|
| 11 |
+
path("autenticacion",
|
| 12 |
+
views.autentication,
|
| 13 |
+
name="autenticacion"),
|
| 14 |
+
|
| 15 |
+
path("catador-login",
|
| 16 |
+
views.catadorLogin,
|
| 17 |
+
name="catador_login"),
|
| 18 |
+
|
| 19 |
+
|
| 20 |
+
# Gestion de catadores
|
| 21 |
+
path("panel-catadores",
|
| 22 |
+
views.testerMenu,
|
| 23 |
+
name="panel_catadores"),
|
| 24 |
+
|
| 25 |
+
path("crear-catador",
|
| 26 |
+
views.testerCreate,
|
| 27 |
+
name="crear_catador"),
|
| 28 |
+
|
| 29 |
+
path("buscar-catador",
|
| 30 |
+
views.testerSearch,
|
| 31 |
+
name="buscar_catador"),
|
| 32 |
+
|
| 33 |
+
|
| 34 |
+
# Creacion de sessiones sensoriales
|
| 35 |
+
path("seleccion-tecnica",
|
| 36 |
+
views.selecionTecnica,
|
| 37 |
+
name="seleccion_tecnica"),
|
| 38 |
+
|
| 39 |
+
path("panel-configuracion-basic",
|
| 40 |
+
views.configurationPanelBasic,
|
| 41 |
+
name="panel_configuracion_basic"),
|
| 42 |
+
|
| 43 |
+
path("panel-configuracion-tags",
|
| 44 |
+
views.configurationPanelTags,
|
| 45 |
+
name="panel_configuracion_tags"),
|
| 46 |
+
|
| 47 |
+
path("panel-configuracion-codes",
|
| 48 |
+
views.configurationPanelCodes,
|
| 49 |
+
name="panel_configuracion_codes"),
|
| 50 |
+
|
| 51 |
+
path("panel-configuracion-words",
|
| 52 |
+
views.configurationPanelWords,
|
| 53 |
+
name="panel_configuracion_words"),
|
| 54 |
+
|
| 55 |
+
path("creando-sesion",
|
| 56 |
+
views.createSession,
|
| 57 |
+
name="creando_sesion"),
|
| 58 |
+
|
| 59 |
+
|
| 60 |
+
# Gestion de sesiones sensoriales
|
| 61 |
+
path("panel-sesiones/<int:page>",
|
| 62 |
+
views.sesionsPanel,
|
| 63 |
+
name="panel_sesiones"),
|
| 64 |
+
|
| 65 |
+
path("detalles-sesion/<str:session_code>",
|
| 66 |
+
views.sessionDetails,
|
| 67 |
+
name="detalles_sesion"),
|
| 68 |
+
|
| 69 |
+
|
| 70 |
+
# APIs
|
| 71 |
+
path("nueva-etiqueta",
|
| 72 |
+
views.newTag,
|
| 73 |
+
name="nueva_etiqueta"),
|
| 74 |
+
|
| 75 |
+
path("api/palabras",
|
| 76 |
+
views.words,
|
| 77 |
+
name="api_palabras"),
|
| 78 |
+
]
|
tecnicas/views/__init__.py
CHANGED
|
@@ -1,15 +1,20 @@
|
|
| 1 |
from .autentication import autentication
|
| 2 |
from .login_catador import catadorLogin
|
| 3 |
from .main_panel import mainPanel
|
| 4 |
-
|
| 5 |
-
from .sessions_panel import sesionsPanel
|
| 6 |
-
from .
|
| 7 |
-
|
| 8 |
-
from .
|
| 9 |
-
from .
|
| 10 |
-
from .
|
| 11 |
-
from .
|
| 12 |
-
from .
|
| 13 |
-
from .
|
| 14 |
-
|
| 15 |
-
from .
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
from .autentication import autentication
|
| 2 |
from .login_catador import catadorLogin
|
| 3 |
from .main_panel import mainPanel
|
| 4 |
+
|
| 5 |
+
from .sessions_management.sessions_panel import sesionsPanel
|
| 6 |
+
from .sessions_management.session_details import sessionDetails
|
| 7 |
+
|
| 8 |
+
from .sessions_config.seleccion_tecnica import selecionTecnica
|
| 9 |
+
from .sessions_config.configuration_panel_basic import configurationPanelBasic
|
| 10 |
+
from .sessions_config.configuration_panel_tags import configurationPanelTags
|
| 11 |
+
from .sessions_config.configuration_panel_codes import configurationPanelCodes
|
| 12 |
+
from .sessions_config.configuration_panel_words import configurationPanelWords
|
| 13 |
+
from .sessions_config.create_session import createSession
|
| 14 |
+
|
| 15 |
+
from .tester_management.tester_menu import testerMenu
|
| 16 |
+
from .tester_management.tester_create import testerCreate
|
| 17 |
+
from .tester_management.tester_search import testerSearch
|
| 18 |
+
|
| 19 |
+
from .apis.api_tag import newTag
|
| 20 |
+
from .apis.api_words import words
|
tecnicas/views/{api_tag.py → apis/api_tag.py}
RENAMED
|
@@ -1,8 +1,8 @@
|
|
| 1 |
from django.http import HttpRequest, JsonResponse
|
| 2 |
from django.db import IntegrityError
|
| 3 |
-
from
|
| 4 |
-
from
|
| 5 |
-
from
|
| 6 |
|
| 7 |
|
| 8 |
def newTag(req: HttpRequest):
|
|
|
|
| 1 |
from django.http import HttpRequest, JsonResponse
|
| 2 |
from django.db import IntegrityError
|
| 3 |
+
from ...models import Etiqueta
|
| 4 |
+
from ...forms import EtiquetaForm
|
| 5 |
+
from ...utils import general_error
|
| 6 |
|
| 7 |
|
| 8 |
def newTag(req: HttpRequest):
|
tecnicas/views/{api_words.py → apis/api_words.py}
RENAMED
|
@@ -1,8 +1,8 @@
|
|
| 1 |
from django.http import HttpRequest, JsonResponse
|
| 2 |
from django.db import IntegrityError
|
| 3 |
-
from
|
| 4 |
-
from
|
| 5 |
-
from
|
| 6 |
|
| 7 |
|
| 8 |
def words(req: HttpRequest):
|
|
|
|
| 1 |
from django.http import HttpRequest, JsonResponse
|
| 2 |
from django.db import IntegrityError
|
| 3 |
+
from ...models import Palabra
|
| 4 |
+
from ...utils import general_error
|
| 5 |
+
from ...forms.word_form import WordForm
|
| 6 |
|
| 7 |
|
| 8 |
def words(req: HttpRequest):
|
tecnicas/views/{configuration_panel_basic.py → sessions_config/configuration_panel_basic.py}
RENAMED
|
@@ -1,8 +1,8 @@
|
|
| 1 |
from django.shortcuts import render, redirect
|
| 2 |
from django.http import HttpRequest
|
| 3 |
from django.urls import reverse
|
| 4 |
-
from
|
| 5 |
-
from
|
| 6 |
|
| 7 |
|
| 8 |
def configurationPanelBasic(req: HttpRequest):
|
|
|
|
| 1 |
from django.shortcuts import render, redirect
|
| 2 |
from django.http import HttpRequest
|
| 3 |
from django.urls import reverse
|
| 4 |
+
from ...forms import SesionBasicForm
|
| 5 |
+
from ...models import TipoTecnica
|
| 6 |
|
| 7 |
|
| 8 |
def configurationPanelBasic(req: HttpRequest):
|
tecnicas/views/{configuration_panel_codes.py → sessions_config/configuration_panel_codes.py}
RENAMED
|
@@ -1,8 +1,8 @@
|
|
| 1 |
from django.http import HttpRequest
|
| 2 |
from django.shortcuts import render, redirect
|
| 3 |
from django.urls import reverse
|
| 4 |
-
from
|
| 5 |
-
from
|
| 6 |
import json
|
| 7 |
|
| 8 |
|
|
|
|
| 1 |
from django.http import HttpRequest
|
| 2 |
from django.shortcuts import render, redirect
|
| 3 |
from django.urls import reverse
|
| 4 |
+
from ...utils import generarCodigos
|
| 5 |
+
from ...forms import CodesForm
|
| 6 |
import json
|
| 7 |
|
| 8 |
|
tecnicas/views/{configuration_panel_tags.py → sessions_config/configuration_panel_tags.py}
RENAMED
|
@@ -1,8 +1,8 @@
|
|
| 1 |
from django.http import HttpRequest
|
| 2 |
from django.shortcuts import redirect, render
|
| 3 |
from django.urls import reverse
|
| 4 |
-
from
|
| 5 |
-
from
|
| 6 |
|
| 7 |
|
| 8 |
def configurationPanelTags(req: HttpRequest):
|
|
|
|
| 1 |
from django.http import HttpRequest
|
| 2 |
from django.shortcuts import redirect, render
|
| 3 |
from django.urls import reverse
|
| 4 |
+
from ...forms import SesionTagsForm, EtiquetaForm
|
| 5 |
+
from ...models import TipoEscala
|
| 6 |
|
| 7 |
|
| 8 |
def configurationPanelTags(req: HttpRequest):
|
tecnicas/views/{configuration_panel_words.py → sessions_config/configuration_panel_words.py}
RENAMED
|
@@ -1,8 +1,8 @@
|
|
| 1 |
from django.http import HttpRequest
|
| 2 |
from django.shortcuts import render, redirect
|
| 3 |
from django.urls import reverse
|
| 4 |
-
from
|
| 5 |
-
from
|
| 6 |
|
| 7 |
import json
|
| 8 |
|
|
|
|
| 1 |
from django.http import HttpRequest
|
| 2 |
from django.shortcuts import render, redirect
|
| 3 |
from django.urls import reverse
|
| 4 |
+
from ...models.palabra import Palabra
|
| 5 |
+
from ...forms import WordForm
|
| 6 |
|
| 7 |
import json
|
| 8 |
|
tecnicas/views/{create_session.py → sessions_config/create_session.py}
RENAMED
|
@@ -1,9 +1,9 @@
|
|
| 1 |
from django.http import HttpRequest, JsonResponse
|
| 2 |
from django.shortcuts import render, redirect
|
| 3 |
from django.urls import reverse
|
| 4 |
-
from
|
| 5 |
-
from
|
| 6 |
-
from
|
| 7 |
|
| 8 |
|
| 9 |
def createSession(req: HttpRequest):
|
|
|
|
| 1 |
from django.http import HttpRequest, JsonResponse
|
| 2 |
from django.shortcuts import render, redirect
|
| 3 |
from django.urls import reverse
|
| 4 |
+
from ...utils import general_error
|
| 5 |
+
from ...controllers import TecnicaController, EscalaController, ProductosController, OrdenesController, EstiloPalabrasController, PalabrasController, SesionController
|
| 6 |
+
from ...models import Presentador
|
| 7 |
|
| 8 |
|
| 9 |
def createSession(req: HttpRequest):
|
tecnicas/views/{seleccion_tecnica.py → sessions_config/seleccion_tecnica.py}
RENAMED
|
@@ -1,7 +1,7 @@
|
|
| 1 |
from django.shortcuts import render
|
| 2 |
from django.http import HttpRequest
|
| 3 |
|
| 4 |
-
from
|
| 5 |
|
| 6 |
def selecionTecnica(req:HttpRequest):
|
| 7 |
tipos = TecnicaController.getTypesTechnique()
|
|
|
|
| 1 |
from django.shortcuts import render
|
| 2 |
from django.http import HttpRequest
|
| 3 |
|
| 4 |
+
from ...controllers import TecnicaController
|
| 5 |
|
| 6 |
def selecionTecnica(req:HttpRequest):
|
| 7 |
tipos = TecnicaController.getTypesTechnique()
|
tecnicas/views/sessions_management/session_details.py
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from django.http import HttpRequest
|
| 2 |
+
from django.shortcuts import render, redirect
|
| 3 |
+
from django.urls import reverse
|
| 4 |
+
from ...controllers import DetallesSesionController
|
| 5 |
+
|
| 6 |
+
|
| 7 |
+
def sessionDetails(req: HttpRequest, session_code: str):
|
| 8 |
+
context = DetallesSesionController.getContextForView(session_code)
|
| 9 |
+
|
| 10 |
+
if req.method == "GET":
|
| 11 |
+
return render(req, "tecnicas/manage_sesions/detalles-sesion.html", context)
|
| 12 |
+
elif req.method == "POST":
|
| 13 |
+
if req.POST["action"] == "start_session":
|
| 14 |
+
response = DetallesSesionController.startRepetition(
|
| 15 |
+
session_code, req.POST.get("username"))
|
| 16 |
+
if isinstance(response, dict):
|
| 17 |
+
context["error"] = response["error"]
|
| 18 |
+
return render(req, "tecnicas/manage_sesions/detalles-sesion.html", context)
|
| 19 |
+
|
| 20 |
+
return redirect(reverse("cata_system:----"))
|
| 21 |
+
elif req.POST.get("action") == "delete_session":
|
| 22 |
+
pass
|
| 23 |
+
elif req.POST.get("action") == "monitor_session":
|
| 24 |
+
pass
|
| 25 |
+
else:
|
| 26 |
+
context["error"] = "no se reconoce la accion a realizar"
|
| 27 |
+
return render(req, "tecnicas/manage_sesions/detalles-sesion.html", context)
|
tecnicas/views/sessions_management/sessions_panel.py
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from django.shortcuts import render
|
| 2 |
+
from ...controllers import SesionController
|
| 3 |
+
|
| 4 |
+
|
| 5 |
+
def sesionsPanel(req, page: int):
|
| 6 |
+
context = {}
|
| 7 |
+
|
| 8 |
+
sessions_in_page = SesionController.getSessionsSavesByCretor(
|
| 9 |
+
user_name="aguBido", page=page)
|
| 10 |
+
|
| 11 |
+
if isinstance(sessions_in_page, dict):
|
| 12 |
+
context["error"] = sessions_in_page["error"]
|
| 13 |
+
return render(req, "tecnicas/manage_sesions/sesiones-panel.html", context=context)
|
| 14 |
+
|
| 15 |
+
context["sessions"] = sessions_in_page
|
| 16 |
+
|
| 17 |
+
number_pages = SesionController.getNumberSessionsByCreator(
|
| 18 |
+
user_name="aguBido")
|
| 19 |
+
if isinstance(number_pages, dict):
|
| 20 |
+
context["num_paginas"] = sessions_in_page["error"]
|
| 21 |
+
return render(req, "tecnicas/manage_sesions/sesiones-panel.html", context=context)
|
| 22 |
+
|
| 23 |
+
context["num_paginas"] = number_pages
|
| 24 |
+
|
| 25 |
+
return render(req, "tecnicas/manage_sesions/sesiones-panel.html", context=context)
|
tecnicas/views/sessions_panel.py
DELETED
|
@@ -1,19 +0,0 @@
|
|
| 1 |
-
from django.shortcuts import render
|
| 2 |
-
|
| 3 |
-
|
| 4 |
-
def sesionsPanel(req):
|
| 5 |
-
elementos = []
|
| 6 |
-
|
| 7 |
-
for i in range(6):
|
| 8 |
-
elementos.append(Elemento("Sesion " + str(i+1), "Hoy", "Convencional"))
|
| 9 |
-
|
| 10 |
-
return render(req, "tecnicas/manage_sesions/sesiones-panel.html", context={"elementos": elementos})
|
| 11 |
-
|
| 12 |
-
# Auxiliar classes
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
class Elemento():
|
| 16 |
-
def __init__(self, nombre, fecha, tecnica):
|
| 17 |
-
self.nombre = nombre
|
| 18 |
-
self.fecha = fecha
|
| 19 |
-
self.tecnica = tecnica
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
tecnicas/views/{tester_create.py → tester_management/tester_create.py}
RENAMED
|
@@ -1,7 +1,7 @@
|
|
| 1 |
from django.http import HttpRequest
|
| 2 |
from django.forms import ValidationError
|
| 3 |
from django.shortcuts import render
|
| 4 |
-
from
|
| 5 |
|
| 6 |
|
| 7 |
def testerCreate(req: HttpRequest):
|
|
|
|
| 1 |
from django.http import HttpRequest
|
| 2 |
from django.forms import ValidationError
|
| 3 |
from django.shortcuts import render
|
| 4 |
+
from ...forms import CatadorForm
|
| 5 |
|
| 6 |
|
| 7 |
def testerCreate(req: HttpRequest):
|
tecnicas/views/{management_catadores.py → tester_management/tester_menu.py}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
| 1 |
from django.shortcuts import render
|
| 2 |
|
| 3 |
-
def
|
| 4 |
return render(req, "tecnicas/manage_tester/catadores-panel.html")
|
|
|
|
| 1 |
from django.shortcuts import render
|
| 2 |
|
| 3 |
+
def testerMenu(req):
|
| 4 |
return render(req, "tecnicas/manage_tester/catadores-panel.html")
|
tecnicas/views/{tester_search.py → tester_management/tester_search.py}
RENAMED
|
@@ -2,8 +2,8 @@ from django.http import HttpRequest
|
|
| 2 |
from django.shortcuts import render, get_object_or_404
|
| 3 |
from django.db import Error
|
| 4 |
from django.core.exceptions import ObjectDoesNotExist
|
| 5 |
-
from
|
| 6 |
-
from
|
| 7 |
|
| 8 |
def testerSearch(req : HttpRequest):
|
| 9 |
if req.method == "GET":
|
|
|
|
| 2 |
from django.shortcuts import render, get_object_or_404
|
| 3 |
from django.db import Error
|
| 4 |
from django.core.exceptions import ObjectDoesNotExist
|
| 5 |
+
from ...forms import CatadorForm
|
| 6 |
+
from ...models import Catador
|
| 7 |
|
| 8 |
def testerSearch(req : HttpRequest):
|
| 9 |
if req.method == "GET":
|