diff --git a/.gitignore b/.gitignore index 4d29575..cd6e419 100755 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,8 @@ # See https://help.github.com/articles/ignoring-files/ for more about ignoring files. +.idea +dist + # dependencies /node_modules /.pnp diff --git a/public/img/wall1.webp b/public/img/wall1.webp new file mode 100644 index 0000000..1ceef0b Binary files /dev/null and b/public/img/wall1.webp differ diff --git a/src/App.tsx b/src/App.tsx index 57fb176..2fa0558 100755 --- a/src/App.tsx +++ b/src/App.tsx @@ -8,6 +8,7 @@ import { SistemasMovil } from "./Views/SistemasMovil"; import { SeleccionCursos } from "./Views/SeleccionCursos"; import { VerMatricula } from "./Views/VerMatricula"; import {SeleccionCursos as SeleccionCursosPC} from "./Views/pc/SeleccionCursos"; +import { VerMatricula as VerMatriculaPC } from "./Views/pc/VerMatricula"; function App() { const route = useRouter(); @@ -41,6 +42,9 @@ function App() { + + + ); diff --git a/src/Views/pc/SeleccionCursos.tsx b/src/Views/pc/SeleccionCursos.tsx index 108c310..24946e0 100644 --- a/src/Views/pc/SeleccionCursos.tsx +++ b/src/Views/pc/SeleccionCursos.tsx @@ -127,7 +127,7 @@ export function SeleccionCursos() { className={css(estilosGlobales.contenedor, estilosGlobales.contenedorCursor, e.botonAccion)} > Iniciar sesion - + diff --git a/src/Views/pc/Sistemas.tsx b/src/Views/pc/Sistemas.tsx index 4d8a1ce..3c2f5c5 100644 --- a/src/Views/pc/Sistemas.tsx +++ b/src/Views/pc/Sistemas.tsx @@ -6,6 +6,18 @@ import { createSignal } from "solid-js"; import { getHorariosMock, ListaCursosCompleto } from "../../API/CargaHorarios"; import { Cursos, DatosGrupo } from "../../types/DatosHorario"; import { infoDiaAListaHoras } from "../SistemasMovil"; +import { StyleSheet, css } from "aphrodite/no-important"; +import { estilosGlobales } from "../../Estilos"; +import { gruposSeleccionados, SERVER_PATH } from "../../Store"; + +const s = StyleSheet.create({ + botonAccion: { + width: "50%", + display: "inline-block", + textAlign: "center", + backgroundColor: "var(--color-primario)", + }, +}); export function Sistemas() { const [data, setData] = createSignal({}); @@ -19,12 +31,43 @@ export function Sistemas() { setData(listaCursosADatos(data)); })(); + const matricular = async() => { + const laboratoriosAMatricular = Object.entries(gruposSeleccionados) + .filter((x) => x[1] === true) + .map((x) => x[0]); + + const response = await fetch(`${SERVER_PATH}/matricula`, { + method: "POST", + headers: { + "Content-Type": "application/json", + }, + body: JSON.stringify({ + correo_usuario: localStorage.getItem("correo"), + horarios: laboratoriosAMatricular, + }), + }); + if (response.ok) { + window.location.href = "#/pc/ver-matricula/"; + } else { + alert("No se pudo procesar la matricula"); + } + }; + return (
+ +
+ +
); diff --git a/src/Views/pc/VerMatricula.tsx b/src/Views/pc/VerMatricula.tsx new file mode 100644 index 0000000..77b819e --- /dev/null +++ b/src/Views/pc/VerMatricula.tsx @@ -0,0 +1,91 @@ +import { css, StyleSheet } from "aphrodite/no-important"; +import { estilosGlobales } from "../../Estilos"; +import { createSignal, For } from "solid-js"; +import { getAllListaCursosMock, RespuestaListaCursos } from "../../API/ListaCursos"; +import { getMatriculaMock, InfoMatricula } from "../../API/VerMatricula"; +import { gruposSeleccionados } from "../../Store"; + +const e = StyleSheet.create({ + contenedorGlobal: { + width: "100vw", + height: "100vh", + display: "flex", + alignItems: "center", + justifyContent: "center", + }, + cont: { + width: "30rem", + }, + parrafo: { + textAlign: "justify", + lineHeight: "1.4rem", + }, + botonAccion: { + width: "30rem", + display: "inline-block", + textAlign: "center", + }, + iconoGitHub: { + fontSize: "1.25rem", + verticalAlign: "bottom", + marginRight: "0.5rem", + }, + inputCorreo: { + width: "100%", + backgroundColor: "rgba(159,159,159,0.44)", + border: "none", + borderBottom: "solid 2px var(--color-texto)", + padding: "0.5rem 1rem", + boxSizing: "border-box", + marginTop: "1rem", + borderRadius: "5px", + }, + checkbox: { + width: "1.25rem", + height: "1.25rem", + margin: "0 0.5rem", + }, + grid: { + display: "grid", + gridTemplateColumns: "3rem auto", + gridRowGap: "1rem", + }, +}); + +export function VerMatricula() { + const [infoMatriculas, setInfoMatriculas] = createSignal>([]); + + (async() => { + const laboratorios = Object.entries(gruposSeleccionados) + .filter((x) => x[1] === true) + .map((x) => parseInt(x[0], 10)); + setInfoMatriculas(await getMatriculaMock({matriculas: laboratorios})); + })(); + + return ( +
+
+ +
+

+ Matricula realizada +

+ + {(matricula) => ( +
+

{matricula.nombre_curso}

+

Grupo: {matricula.grupo}

+

Docente: {matricula.docente}

+
+ )} +
+ +
+
+
+ ); +}