Move files around
This commit is contained in:
parent
757e0a5f66
commit
a419bad242
6
src/controller/mod.rs
Normal file
6
src/controller/mod.rs
Normal file
@ -0,0 +1,6 @@
|
||||
use maud::Markup;
|
||||
|
||||
#[get("/")]
|
||||
pub fn homepage() -> Markup {
|
||||
crate::view::homepage()
|
||||
}
|
48
src/main.rs
48
src/main.rs
@ -1,59 +1,15 @@
|
||||
#[macro_use]
|
||||
extern crate rocket;
|
||||
|
||||
mod controller;
|
||||
mod view;
|
||||
|
||||
use maud::{html, Markup};
|
||||
use rocket::fs::{relative, FileServer};
|
||||
|
||||
#[get("/")]
|
||||
fn index() -> Markup {
|
||||
view::skeleton(html! {
|
||||
h1 class="font-bold text-4xl text-center text-primary"
|
||||
{
|
||||
"Sistema EEGSAC"
|
||||
}
|
||||
br;
|
||||
form action="/login" method="post" {
|
||||
label class="form-control w-full max-w-xs"
|
||||
{
|
||||
div class="label"
|
||||
{
|
||||
span class="label-text"
|
||||
{
|
||||
"Usuario"
|
||||
}
|
||||
}
|
||||
input type="text"
|
||||
placeholder="Usuario"
|
||||
required
|
||||
class="input input-bordered input-primary w-full max-w-xs";
|
||||
}
|
||||
label class="form-control w-full max-w-xs"
|
||||
{
|
||||
div class="label"
|
||||
{
|
||||
span class="label-text"
|
||||
{
|
||||
"Contraseña"
|
||||
}
|
||||
}
|
||||
input type="password"
|
||||
placeholder="Contraseña"
|
||||
required
|
||||
class="input input-bordered input-primary w-full max-w-xs";
|
||||
}
|
||||
button class="btn btn-primary"
|
||||
{
|
||||
"Iniciar sesión"
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
#[launch]
|
||||
fn rocket() -> _ {
|
||||
rocket::build()
|
||||
.mount("/", routes![index])
|
||||
.mount("/", routes![controller::homepage])
|
||||
.mount("/static", FileServer::from(relative!("static")))
|
||||
}
|
||||
|
@ -3,11 +3,11 @@ use maud::{html, Markup, DOCTYPE};
|
||||
pub fn skeleton(body: Markup) -> Markup {
|
||||
html! {
|
||||
(DOCTYPE)
|
||||
html lang="es" data-theme="dracula" {
|
||||
html lang="es" data-theme="cupcake" {
|
||||
head {
|
||||
title { "Sistema :D" }
|
||||
title { "Jerguero" }
|
||||
meta name="viewport" content="width=device-width, initial-scale=1.0";
|
||||
link rel="stylesheet" type="text/css" href="/static/styles.css";
|
||||
link rel="stylesheet" type="text/css" href="/static/out.css";
|
||||
}
|
||||
body {
|
||||
(body)
|
||||
@ -15,3 +15,33 @@ pub fn skeleton(body: Markup) -> Markup {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fn navbar() -> Markup {
|
||||
html! {
|
||||
nav class="navbar gap-1 fixed bottom-0 left-0 w-full border-t border-t-neutral" {
|
||||
div class="flex-none" {
|
||||
a class="btn btn-ghost text-xl" {
|
||||
"J"
|
||||
}
|
||||
}
|
||||
div class="flex-1" {
|
||||
div class="form-control" {
|
||||
input type="text" placeholder="Search" class="input input-bordered w-full md:w-auto";
|
||||
}
|
||||
}
|
||||
div class="flex-none" {
|
||||
a class="btn btn-ghost text-xl" {
|
||||
"s"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pub fn homepage() -> Markup {
|
||||
skeleton(html! {
|
||||
(navbar())
|
||||
h1 { "Jerguero" }
|
||||
p { "¡Bienvenido a Jerguero!" }
|
||||
})
|
||||
}
|
||||
|
@ -9,6 +9,39 @@ module.exports = {
|
||||
},
|
||||
plugins: [require("daisyui")],
|
||||
daisyui: {
|
||||
themes: ["retro", "coffee", "dracula"]
|
||||
themes: [
|
||||
"light",
|
||||
"dark",
|
||||
"cupcake",
|
||||
"bumblebee",
|
||||
"emerald",
|
||||
"corporate",
|
||||
"synthwave",
|
||||
"retro",
|
||||
"cyberpunk",
|
||||
"valentine",
|
||||
"halloween",
|
||||
"garden",
|
||||
"forest",
|
||||
"aqua",
|
||||
"lofi",
|
||||
"pastel",
|
||||
"fantasy",
|
||||
"wireframe",
|
||||
"black",
|
||||
"luxury",
|
||||
"dracula",
|
||||
"cmyk",
|
||||
"autumn",
|
||||
"business",
|
||||
"acid",
|
||||
"lemonade",
|
||||
"night",
|
||||
"coffee",
|
||||
"winter",
|
||||
"dim",
|
||||
"nord",
|
||||
"sunset",
|
||||
]
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user