Compare commits
No commits in common. "f21823e73c883794939af5920ed60db772700b1f" and "fe40a3ba21bc151d27472908e483de7dbfb125bc" have entirely different histories.
f21823e73c
...
fe40a3ba21
156
Cargo.lock
generated
156
Cargo.lock
generated
@ -17,41 +17,6 @@ version = "1.0.2"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe"
|
checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe"
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "aead"
|
|
||||||
version = "0.5.2"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "d122413f284cf2d62fb1b7db97e02edb8cda96d769b16e443a4f6195e35662b0"
|
|
||||||
dependencies = [
|
|
||||||
"crypto-common",
|
|
||||||
"generic-array",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "aes"
|
|
||||||
version = "0.8.4"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "b169f7a6d4742236a0a00c541b845991d0ac43e546831af1249753ab4c3aa3a0"
|
|
||||||
dependencies = [
|
|
||||||
"cfg-if",
|
|
||||||
"cipher",
|
|
||||||
"cpufeatures",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "aes-gcm"
|
|
||||||
version = "0.10.3"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "831010a0f742e1209b3bcea8fab6a8e149051ba6099432c8cb2cc117dec3ead1"
|
|
||||||
dependencies = [
|
|
||||||
"aead",
|
|
||||||
"aes",
|
|
||||||
"cipher",
|
|
||||||
"ctr",
|
|
||||||
"ghash",
|
|
||||||
"subtle",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "ahash"
|
name = "ahash"
|
||||||
version = "0.8.7"
|
version = "0.8.7"
|
||||||
@ -243,16 +208,6 @@ version = "1.0.0"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd"
|
checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd"
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "cipher"
|
|
||||||
version = "0.4.4"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "773f3b9af64447d2ce9850330c473515014aa235e6a783b02db81ff39e4a3dad"
|
|
||||||
dependencies = [
|
|
||||||
"crypto-common",
|
|
||||||
"inout",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "const-oid"
|
name = "const-oid"
|
||||||
version = "0.9.6"
|
version = "0.9.6"
|
||||||
@ -265,13 +220,7 @@ version = "0.18.0"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "3cd91cf61412820176e137621345ee43b3f4423e589e7ae4e50d601d93e35ef8"
|
checksum = "3cd91cf61412820176e137621345ee43b3f4423e589e7ae4e50d601d93e35ef8"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"aes-gcm",
|
|
||||||
"base64",
|
|
||||||
"hkdf",
|
|
||||||
"percent-encoding",
|
"percent-encoding",
|
||||||
"rand",
|
|
||||||
"sha2",
|
|
||||||
"subtle",
|
|
||||||
"time",
|
"time",
|
||||||
"version_check",
|
"version_check",
|
||||||
]
|
]
|
||||||
@ -322,19 +271,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
|||||||
checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3"
|
checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"generic-array",
|
"generic-array",
|
||||||
"rand_core",
|
|
||||||
"typenum",
|
"typenum",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "ctr"
|
|
||||||
version = "0.9.2"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "0369ee1ad671834580515889b80f2ea915f23b8be8d0daa4bbaf2ac5c7590835"
|
|
||||||
dependencies = [
|
|
||||||
"cipher",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "der"
|
name = "der"
|
||||||
version = "0.7.8"
|
version = "0.7.8"
|
||||||
@ -630,16 +569,6 @@ dependencies = [
|
|||||||
"wasi",
|
"wasi",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "ghash"
|
|
||||||
version = "0.5.1"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "f0d8a4362ccb29cb0b265253fb0a2728f592895ee6854fd9bc13f2ffda266ff1"
|
|
||||||
dependencies = [
|
|
||||||
"opaque-debug",
|
|
||||||
"polyval",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "gimli"
|
name = "gimli"
|
||||||
version = "0.28.1"
|
version = "0.28.1"
|
||||||
@ -663,7 +592,7 @@ dependencies = [
|
|||||||
"futures-core",
|
"futures-core",
|
||||||
"futures-sink",
|
"futures-sink",
|
||||||
"futures-util",
|
"futures-util",
|
||||||
"http 0.2.11",
|
"http",
|
||||||
"indexmap",
|
"indexmap",
|
||||||
"slab",
|
"slab",
|
||||||
"tokio",
|
"tokio",
|
||||||
@ -749,17 +678,6 @@ dependencies = [
|
|||||||
"itoa",
|
"itoa",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "http"
|
|
||||||
version = "1.1.0"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "21b9ddb458710bc376481b842f5da65cdf31522de232c1ca8146abce2a358258"
|
|
||||||
dependencies = [
|
|
||||||
"bytes",
|
|
||||||
"fnv",
|
|
||||||
"itoa",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "http-body"
|
name = "http-body"
|
||||||
version = "0.4.6"
|
version = "0.4.6"
|
||||||
@ -767,7 +685,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
|||||||
checksum = "7ceab25649e9960c0311ea418d17bee82c0dcec1bd053b5f9a66e265a693bed2"
|
checksum = "7ceab25649e9960c0311ea418d17bee82c0dcec1bd053b5f9a66e265a693bed2"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bytes",
|
"bytes",
|
||||||
"http 0.2.11",
|
"http",
|
||||||
"pin-project-lite",
|
"pin-project-lite",
|
||||||
]
|
]
|
||||||
|
|
||||||
@ -794,7 +712,7 @@ dependencies = [
|
|||||||
"futures-core",
|
"futures-core",
|
||||||
"futures-util",
|
"futures-util",
|
||||||
"h2",
|
"h2",
|
||||||
"http 0.2.11",
|
"http",
|
||||||
"http-body",
|
"http-body",
|
||||||
"httparse",
|
"httparse",
|
||||||
"httpdate",
|
"httpdate",
|
||||||
@ -834,23 +752,14 @@ version = "0.1.15"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "c8fae54786f62fb2918dcfae3d568594e50eb9b5c25bf04371af6fe7516452fb"
|
checksum = "c8fae54786f62fb2918dcfae3d568594e50eb9b5c25bf04371af6fe7516452fb"
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "inout"
|
|
||||||
version = "0.1.3"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "a0c10553d664a4d0bcff9f4215d0aac67a639cc68ef660840afe309b807bc9f5"
|
|
||||||
dependencies = [
|
|
||||||
"generic-array",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "is-terminal"
|
name = "is-terminal"
|
||||||
version = "0.4.12"
|
version = "0.4.10"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "f23ff5ef2b80d608d61efee834934d862cd92461afc0560dedf493e4c033738b"
|
checksum = "0bad00257d07be169d870ab665980b06cdb366d792ad690bf2e76876dc503455"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"hermit-abi",
|
"hermit-abi",
|
||||||
"libc",
|
"rustix",
|
||||||
"windows-sys 0.52.0",
|
"windows-sys 0.52.0",
|
||||||
]
|
]
|
||||||
|
|
||||||
@ -1029,15 +938,16 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "multer"
|
name = "multer"
|
||||||
version = "3.1.0"
|
version = "2.1.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "83e87776546dc87511aa5ee218730c92b666d7264ab6ed41f9d215af9cd5224b"
|
checksum = "01acbdc23469fd8fe07ab135923371d5f5a422fbf9c522158677c8eb15bc51c2"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bytes",
|
"bytes",
|
||||||
"encoding_rs",
|
"encoding_rs",
|
||||||
"futures-util",
|
"futures-util",
|
||||||
"http 1.1.0",
|
"http",
|
||||||
"httparse",
|
"httparse",
|
||||||
|
"log",
|
||||||
"memchr",
|
"memchr",
|
||||||
"mime",
|
"mime",
|
||||||
"spin 0.9.8",
|
"spin 0.9.8",
|
||||||
@ -1156,12 +1066,6 @@ version = "1.19.0"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92"
|
checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92"
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "opaque-debug"
|
|
||||||
version = "0.3.1"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "c08d65885ee38876c4f86fa503fb49d7b507c2b62552df7c70b2fce627e06381"
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "overload"
|
name = "overload"
|
||||||
version = "0.1.1"
|
version = "0.1.1"
|
||||||
@ -1274,18 +1178,6 @@ version = "0.3.29"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "2900ede94e305130c13ddd391e0ab7cbaeb783945ae07a279c268cb05109c6cb"
|
checksum = "2900ede94e305130c13ddd391e0ab7cbaeb783945ae07a279c268cb05109c6cb"
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "polyval"
|
|
||||||
version = "0.6.2"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "9d1fe60d06143b2430aa532c94cfe9e29783047f06c0d7fd359a9a51b729fa25"
|
|
||||||
dependencies = [
|
|
||||||
"cfg-if",
|
|
||||||
"cpufeatures",
|
|
||||||
"opaque-debug",
|
|
||||||
"universal-hash",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "powerfmt"
|
name = "powerfmt"
|
||||||
version = "0.2.0"
|
version = "0.2.0"
|
||||||
@ -1457,9 +1349,9 @@ checksum = "c08c74e62047bb2de4ff487b251e4a92e24f48745648451635cec7d591162d9f"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "rocket"
|
name = "rocket"
|
||||||
version = "0.5.1"
|
version = "0.5.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "a516907296a31df7dc04310e7043b61d71954d703b603cc6867a026d7e72d73f"
|
checksum = "9e7bb57ccb26670d73b6a47396c83139447b9e7878cab627fdfe9ea8da489150"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"async-stream",
|
"async-stream",
|
||||||
"async-trait",
|
"async-trait",
|
||||||
@ -1494,9 +1386,9 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "rocket_codegen"
|
name = "rocket_codegen"
|
||||||
version = "0.5.1"
|
version = "0.5.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "575d32d7ec1a9770108c879fc7c47815a80073f96ca07ff9525a94fcede1dd46"
|
checksum = "a2238066abf75f21be6cd7dc1a09d5414a671f4246e384e49fe3f8a4936bd04c"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"devise",
|
"devise",
|
||||||
"glob",
|
"glob",
|
||||||
@ -1511,14 +1403,14 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "rocket_http"
|
name = "rocket_http"
|
||||||
version = "0.5.1"
|
version = "0.5.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "e274915a20ee3065f611c044bd63c40757396b6dbc057d6046aec27f14f882b9"
|
checksum = "37a1663694d059fe5f943ea5481363e48050acedd241d46deb2e27f71110389e"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"cookie",
|
"cookie",
|
||||||
"either",
|
"either",
|
||||||
"futures",
|
"futures",
|
||||||
"http 0.2.11",
|
"http",
|
||||||
"hyper",
|
"hyper",
|
||||||
"indexmap",
|
"indexmap",
|
||||||
"log",
|
"log",
|
||||||
@ -2316,16 +2208,6 @@ version = "0.1.1"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "39ec24b3121d976906ece63c9daad25b85969647682eee313cb5779fdd69e14e"
|
checksum = "39ec24b3121d976906ece63c9daad25b85969647682eee313cb5779fdd69e14e"
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "universal-hash"
|
|
||||||
version = "0.5.1"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "fc1de2c688dc15305988b563c3854064043356019f97a4b46276fe734c4f07ea"
|
|
||||||
dependencies = [
|
|
||||||
"crypto-common",
|
|
||||||
"subtle",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "url"
|
name = "url"
|
||||||
version = "2.5.0"
|
version = "2.5.0"
|
||||||
@ -2556,9 +2438,9 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "yansi"
|
name = "yansi"
|
||||||
version = "1.0.1"
|
version = "1.0.0-rc.1"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "cfe53a6657fd280eaa890a3bc59152892ffa3e30101319d168b781ed6529b049"
|
checksum = "1367295b8f788d371ce2dbc842c7b709c73ee1364d30351dd300ec2203b12377"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"is-terminal",
|
"is-terminal",
|
||||||
]
|
]
|
||||||
|
@ -7,5 +7,5 @@ edition = "2021"
|
|||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
maud = { version = "0.26.0", features = ["rocket"] }
|
maud = { version = "0.26.0", features = ["rocket"] }
|
||||||
rocket = { version = "0.5.1", features = ["secrets"] }
|
rocket = "0.5.0"
|
||||||
sqlx = { version = "0.7.3", features = ["postgres"] }
|
sqlx = { version = "0.7.3", features = ["postgres"] }
|
||||||
|
@ -5,7 +5,6 @@
|
|||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build": "echo \"Error: no test specified\" && exit 1",
|
"build": "echo \"Error: no test specified\" && exit 1",
|
||||||
"dev": "tailwindcss -i ./static/tailwind.css -o ./static/out.css --watch",
|
|
||||||
"tailwind": "tailwindcss -i ./static/tailwind.css -o ./static/out.css --watch"
|
"tailwind": "tailwindcss -i ./static/tailwind.css -o ./static/out.css --watch"
|
||||||
},
|
},
|
||||||
"keywords": [],
|
"keywords": [],
|
||||||
|
@ -1,43 +1,6 @@
|
|||||||
use std::time::Duration;
|
|
||||||
|
|
||||||
use maud::Markup;
|
use maud::Markup;
|
||||||
use rocket::{form::Form, http::Status, response::Redirect, tokio::time::sleep};
|
|
||||||
|
|
||||||
mod utils;
|
|
||||||
|
|
||||||
#[get("/")]
|
#[get("/")]
|
||||||
pub fn homepage() -> Markup {
|
pub fn homepage() -> Markup {
|
||||||
crate::view::homepage()
|
crate::view::homepage()
|
||||||
}
|
}
|
||||||
|
|
||||||
#[get("/new")]
|
|
||||||
pub fn new_definition(_user: utils::User) -> (Status, Markup) {
|
|
||||||
todo!()
|
|
||||||
}
|
|
||||||
|
|
||||||
#[get("/new", rank = 2)]
|
|
||||||
pub fn new_definition_redirect() -> Redirect {
|
|
||||||
println!("carita feliz :D");
|
|
||||||
Redirect::to("/login")
|
|
||||||
}
|
|
||||||
|
|
||||||
#[derive(FromForm)]
|
|
||||||
pub struct LoginData {
|
|
||||||
pub login_email: String,
|
|
||||||
pub login_password: String,
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
#[get("/login")]
|
|
||||||
pub fn login_page() -> Markup {
|
|
||||||
crate::view::login::login()
|
|
||||||
}
|
|
||||||
|
|
||||||
#[post("/login", data = "<data>")]
|
|
||||||
pub async fn login(data: Form<LoginData>) -> (Status, String) {
|
|
||||||
println!("begin request: {}", data.login_email);
|
|
||||||
// Simulate trip to db
|
|
||||||
sleep(Duration::new(5, 0)).await;
|
|
||||||
println!("end request: {}", data.login_password);
|
|
||||||
(Status::Ok, ":D".into())
|
|
||||||
}
|
|
||||||
|
@ -1,28 +0,0 @@
|
|||||||
use rocket::{
|
|
||||||
http::Status,
|
|
||||||
request::{FromRequest, Outcome, Request},
|
|
||||||
};
|
|
||||||
|
|
||||||
/// Name of the header that stores the session ID of an user
|
|
||||||
const RS_SESSION_ID: &str = "x-rs-session-id";
|
|
||||||
|
|
||||||
pub struct User {}
|
|
||||||
|
|
||||||
#[rocket::async_trait]
|
|
||||||
impl<'r> FromRequest<'r> for User {
|
|
||||||
type Error = String;
|
|
||||||
|
|
||||||
async fn from_request(req: &'r Request<'_>) -> Outcome<Self, Self::Error> {
|
|
||||||
let session_cookie = req.cookies().get_private(RS_SESSION_ID);
|
|
||||||
|
|
||||||
let _session_cookie = match session_cookie {
|
|
||||||
Some(cookie) => cookie.value().to_string(),
|
|
||||||
None => return Outcome::Forward(Status::Unauthorized),
|
|
||||||
};
|
|
||||||
|
|
||||||
// Check if session cookie is valid
|
|
||||||
// TODO
|
|
||||||
|
|
||||||
Outcome::Success(User {})
|
|
||||||
}
|
|
||||||
}
|
|
11
src/main.rs
11
src/main.rs
@ -9,15 +9,6 @@ use rocket::fs::{relative, FileServer};
|
|||||||
#[launch]
|
#[launch]
|
||||||
fn rocket() -> _ {
|
fn rocket() -> _ {
|
||||||
rocket::build()
|
rocket::build()
|
||||||
.mount(
|
.mount("/", routes![controller::homepage])
|
||||||
"/",
|
|
||||||
routes![
|
|
||||||
controller::homepage,
|
|
||||||
controller::new_definition,
|
|
||||||
controller::new_definition_redirect,
|
|
||||||
controller::login_page,
|
|
||||||
controller::login,
|
|
||||||
],
|
|
||||||
)
|
|
||||||
.mount("/static", FileServer::from(relative!("static")))
|
.mount("/static", FileServer::from(relative!("static")))
|
||||||
}
|
}
|
||||||
|
@ -1,56 +0,0 @@
|
|||||||
use maud::{html, Markup};
|
|
||||||
|
|
||||||
use super::skeleton;
|
|
||||||
|
|
||||||
pub fn login() -> Markup {
|
|
||||||
skeleton(html! {
|
|
||||||
h1 class="text-3xl font-bold text-center my-4 fixed top-0 w-screen" {
|
|
||||||
"Jerguero"
|
|
||||||
}
|
|
||||||
div class="flex items-center h-screen w-full" {
|
|
||||||
div class="container mx-auto" {
|
|
||||||
p class="my-4 p-2 rounded bg-c-bg-2 text-c-on-bg" {
|
|
||||||
"¡Iniciá sesión para comenzar a crear definiciones!"
|
|
||||||
}
|
|
||||||
form class="my-4 py-4 px-2 rounded bg-c-bg-2 text-c-on-bg"
|
|
||||||
"hx-post"="/login"
|
|
||||||
{
|
|
||||||
div class="py-2" {
|
|
||||||
label class="text-sm opacity-85" for="login-email" {"Correo electronico:"}
|
|
||||||
br;
|
|
||||||
input
|
|
||||||
class="inline-block w-full rounded bg-c-bg text-c-on-bg py-2 px-1
|
|
||||||
disabled:cursor-not-allowed disabled:opacity-50 transition-opacity"
|
|
||||||
id="login-email" name="login_email" type="email"
|
|
||||||
required
|
|
||||||
data-loading-disable="true";
|
|
||||||
}
|
|
||||||
|
|
||||||
div class="py-2" {
|
|
||||||
label class="text-sm opacity-85" for="login-password" {"Contraseña:"}
|
|
||||||
br;
|
|
||||||
input
|
|
||||||
class="inline-block w-full rounded bg-c-bg text-c-on-bg py-2 px-1
|
|
||||||
disabled:cursor-not-allowed disabled:opacity-50 transition-opacity"
|
|
||||||
id="login-password" name="login_password" type="password"
|
|
||||||
min="8"
|
|
||||||
max="64"
|
|
||||||
required
|
|
||||||
data-loading-disable="true";
|
|
||||||
}
|
|
||||||
|
|
||||||
div class="text-center pt-2" {
|
|
||||||
button
|
|
||||||
type="submit"
|
|
||||||
class="py-1 px-2 rounded bg-c-primary text-c-on-primary hover:underline
|
|
||||||
disabled:cursor-not-allowed disabled:animate-pulse"
|
|
||||||
data-loading-disable
|
|
||||||
{
|
|
||||||
"Iniciar sesión"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
@ -1,7 +1,6 @@
|
|||||||
use maud::{html, Markup, DOCTYPE};
|
use maud::{html, Markup, DOCTYPE};
|
||||||
|
|
||||||
mod icons;
|
mod icons;
|
||||||
pub mod login;
|
|
||||||
|
|
||||||
use icons::{bird, magnifying_glass};
|
use icons::{bird, magnifying_glass};
|
||||||
|
|
||||||
@ -21,13 +20,10 @@ pub fn skeleton(body: Markup) -> Markup {
|
|||||||
link rel="preconnect" href="https://fonts.googleapis.com";
|
link rel="preconnect" href="https://fonts.googleapis.com";
|
||||||
link rel="preconnect" href="https://fonts.gstatic.com" crossorigin;
|
link rel="preconnect" href="https://fonts.gstatic.com" crossorigin;
|
||||||
link href="https://fonts.googleapis.com/css2?family=Radio+Canada+Big:ital,wght@0,400..700;1,400..700&display=swap" rel="stylesheet";
|
link href="https://fonts.googleapis.com/css2?family=Radio+Canada+Big:ital,wght@0,400..700;1,400..700&display=swap" rel="stylesheet";
|
||||||
// htmx
|
|
||||||
script src="https://unpkg.com/htmx.org@2.0.0" {}
|
|
||||||
script src="https://unpkg.com/htmx-ext-loading-states@2.0.0/loading-states.js" {}
|
|
||||||
// hyperscript
|
// hyperscript
|
||||||
script src="https://unpkg.com/hyperscript.org@0.9.12" defer {}
|
script src="https://unpkg.com/hyperscript.org@0.9.12" defer {}
|
||||||
}
|
}
|
||||||
body hx-ext="loading-states" {
|
body {
|
||||||
(body)
|
(body)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -92,13 +88,6 @@ pub fn homepage() -> Markup {
|
|||||||
div class="bg-accent text-accent-content py-2 m-1 rounded-md text-center font-bold text-lg" {
|
div class="bg-accent text-accent-content py-2 m-1 rounded-md text-center font-bold text-lg" {
|
||||||
"Jerguero"
|
"Jerguero"
|
||||||
}
|
}
|
||||||
div class="text-center p-2" {
|
|
||||||
a class="py-1 px-2 rounded bg-c-primary text-c-on-primary hover:underline"
|
|
||||||
href="/new"
|
|
||||||
{
|
|
||||||
"Agregá una nueva definición"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
(post())
|
(post())
|
||||||
(post())
|
(post())
|
||||||
(post())
|
(post())
|
||||||
|
@ -4,7 +4,6 @@
|
|||||||
|
|
||||||
:root {
|
:root {
|
||||||
--c-primary: #0ea5e9;
|
--c-primary: #0ea5e9;
|
||||||
--c-on-primary: white;
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -21,7 +20,7 @@
|
|||||||
--c-bg: #0a0a0a;
|
--c-bg: #0a0a0a;
|
||||||
--c-on-bg: white;
|
--c-on-bg: white;
|
||||||
|
|
||||||
--c-bg-2: #0f1c25;
|
--c-bg-2: #051c2c;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -30,9 +29,4 @@ html {
|
|||||||
color: var(--c-on-bg);
|
color: var(--c-on-bg);
|
||||||
font-family: "Radio Canada Big", sans-serif;
|
font-family: "Radio Canada Big", sans-serif;
|
||||||
font-optical-sizing: auto;
|
font-optical-sizing: auto;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* htmx: data-loading extension */
|
|
||||||
[data-loading] {
|
|
||||||
display: none;
|
|
||||||
}
|
|
@ -14,7 +14,6 @@ module.exports = {
|
|||||||
},
|
},
|
||||||
colors: {
|
colors: {
|
||||||
"c-primary": "var(--c-primary)",
|
"c-primary": "var(--c-primary)",
|
||||||
"c-on-primary": "var(--c-on-primary)",
|
|
||||||
"c-bg": "var(--c-bg)",
|
"c-bg": "var(--c-bg)",
|
||||||
"c-bg-2": "var(--c-bg-2)",
|
"c-bg-2": "var(--c-bg-2)",
|
||||||
"c-on-bg": "var(--c-on-bg)",
|
"c-on-bg": "var(--c-on-bg)",
|
||||||
|
Loading…
Reference in New Issue
Block a user