[FE][Certs] Highlight registers created today
This commit is contained in:
parent
a0bf96a4c1
commit
9768daed44
1
backend/.gitignore
vendored
1
backend/.gitignore
vendored
@ -1,2 +1,3 @@
|
||||
target
|
||||
.env
|
||||
aulavirtual
|
||||
|
@ -10,6 +10,7 @@ extern crate rocket;
|
||||
mod controller;
|
||||
mod cors;
|
||||
mod model;
|
||||
mod online_classroom;
|
||||
|
||||
static DB: OnceCell<Pool<MySql>> = OnceCell::new();
|
||||
|
||||
|
6
backend/src/online_classroom/mod.rs
Normal file
6
backend/src/online_classroom/mod.rs
Normal file
@ -0,0 +1,6 @@
|
||||
|
||||
pub fn get_cookie() {
|
||||
|
||||
}
|
||||
|
||||
|
@ -2,6 +2,7 @@ import { Route, Routes } from "@solidjs/router";
|
||||
import type { Component } from "solid-js";
|
||||
import { Certs } from "./certs";
|
||||
import { NavRail } from "./components/NavRail";
|
||||
import { OnlineClassroom } from "./OnlineClassroom";
|
||||
|
||||
const App: Component = () => (
|
||||
<div class="grid grid-cols-[5rem_auto]">
|
||||
@ -9,7 +10,7 @@ const App: Component = () => (
|
||||
<Routes>
|
||||
<Route path="/" component={() => <p>En construccion</p>} />
|
||||
<Route path="/certs" component={Certs} />
|
||||
<Route path="/accesos" component={() => <p>En construccion</p>} />
|
||||
<Route path="/accesos" component={OnlineClassroom} />
|
||||
<Route path="/escaneo" component={() => <p>En construccion</p>} />
|
||||
</Routes>
|
||||
</div>
|
||||
|
26
frontend/src/OnlineClassroom/index.tsx
Normal file
26
frontend/src/OnlineClassroom/index.tsx
Normal file
@ -0,0 +1,26 @@
|
||||
import { Show, createSignal } from "solid-js";
|
||||
import { Search } from "../certs/Search";
|
||||
import { Person } from "../types/Person";
|
||||
|
||||
export function OnlineClassroom() {
|
||||
const [person, setPerson] = createSignal<Person | null>(null);
|
||||
|
||||
return (
|
||||
<div class="grid grid-cols-[16rem_25rem_1fr]">
|
||||
<Search setPerson={setPerson} />
|
||||
<Show when={person()}>
|
||||
<ClassroomUsers person={person()!} />
|
||||
</Show>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
function ClassroomUsers(props: {person: Person}) {
|
||||
return (
|
||||
<div>
|
||||
<h2 class="text-xl">
|
||||
Usuarios para {props.person.person_names}:
|
||||
</h2>
|
||||
</div>
|
||||
);
|
||||
}
|
@ -179,22 +179,31 @@ function RegisterEl(props: {register: Register, person: Person, onClick: () => v
|
||||
return certGenerator[courseN] !== undefined;
|
||||
};
|
||||
|
||||
const createdTodayClasses = () => {
|
||||
// current dat in YYYY-MM-DD format
|
||||
const today = new Date().toISOString()
|
||||
.split("T")[0];
|
||||
const createdToday = props.register.register_creation_date === today;
|
||||
|
||||
return createdToday ? "bg-c-surface-variant" : "";
|
||||
};
|
||||
|
||||
return (
|
||||
<div class="grid grid-cols-[11rem_1.5rem_1.25rem] border border-c-outline rounded-md">
|
||||
<div class="p-1 border-r border-c-outline-50 align-middle">
|
||||
<div class="grid grid-cols-[11rem_1.5rem_1.25rem] border border-c-outline rounded-md overflow-hidden">
|
||||
<div class="border-r border-c-outline-50 align-middle">
|
||||
<p
|
||||
class="font-bold overflow-hidden whitespace-nowrap"
|
||||
class="font-bold overflow-hidden whitespace-nowrap pt-1 px-1"
|
||||
title={`${courseName()} ${customLabel()}`}
|
||||
>
|
||||
{courseName()}
|
||||
</p>
|
||||
<p class="font-mono text-sm">
|
||||
<p class="font-mono text-sm px-1">
|
||||
<span class="underline">
|
||||
{customLabel()}
|
||||
</span>
|
||||
|
||||
</p>
|
||||
<p class="text-sm">
|
||||
<p class={`text-sm px-1 pb-1 ${createdTodayClasses()}`}>
|
||||
<span class="font-mono">
|
||||
{displayDate()}
|
||||
</span>
|
||||
|
Loading…
Reference in New Issue
Block a user