From 130d8b00ab32deab76a5a3b101004bee51f78dbd Mon Sep 17 00:00:00 2001 From: Lennart <18233294+lennart-k@users.noreply.github.com> Date: Sun, 10 Nov 2024 13:18:45 +0100 Subject: [PATCH] frontend: some changes --- Cargo.lock | 21 ++++++++ Cargo.toml | 51 ++++++++++--------- crates/frontend/Cargo.toml | 2 +- crates/frontend/public/assets/style.css | 3 ++ .../public/templates/layouts/default.html | 1 + .../public/templates/pages/addressbook.html | 9 +++- .../public/templates/pages/calendar.html | 7 ++- .../frontend/public/templates/pages/user.html | 32 ++++++++++++ crates/frontend/src/lib.rs | 4 ++ 9 files changed, 103 insertions(+), 27 deletions(-) create mode 100644 crates/frontend/public/assets/style.css diff --git a/Cargo.lock b/Cargo.lock index b4dba1a..025b5b7 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -407,6 +407,8 @@ dependencies = [ "num-traits", "percent-encoding", "serde", + "serde_json", + "serde_yaml", ] [[package]] @@ -2673,6 +2675,19 @@ dependencies = [ "serde", ] +[[package]] +name = "serde_yaml" +version = "0.9.34+deprecated" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6a8b1a1a2ebf674015cc02edccce75287f1a0130d394307b36743c2f5d504b47" +dependencies = [ + "indexmap 2.6.0", + "itoa", + "ryu", + "serde", + "unsafe-libyaml", +] + [[package]] name = "sha1" version = "0.10.6" @@ -3476,6 +3491,12 @@ dependencies = [ "subtle", ] +[[package]] +name = "unsafe-libyaml" +version = "0.2.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "673aac59facbab8a9007c7f6108d11f63b603f7cabff99fabf650fea5c32b861" + [[package]] name = "url" version = "2.5.2" diff --git a/Cargo.toml b/Cargo.toml index fcdc67a..9ce72c1 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -39,19 +39,19 @@ rstest = "0.23" rstest_reuse = "0.7" sha2 = "0.10" tokio = { version = "1", features = [ - "net", - "tracing", - "macros", - "rt-multi-thread", - "full", + "net", + "tracing", + "macros", + "rt-multi-thread", + "full", ] } url = "2.5" base64 = "0.22" thiserror = "1.0" quick-xml = { version = "0.37", features = [ - "serde", - "serde-types", - "serialize", + "serde", + "serde-types", + "serialize", ] } rust-embed = "8.5" futures-core = "0.3.31" @@ -61,21 +61,26 @@ itertools = "0.13" log = "0.4" strum = { version = "0.26", features = ["strum_macros", "derive"] } derive_more = { version = "1.0", features = [ - "from", - "try_into", - "into", - "deref", + "from", + "try_into", + "into", + "deref", +] } +askama = { version = "0.12", features = [ + "serde", + "with-actix-web", + "serde-json", + "serde-yaml", ] } -askama = { version = "0.12", features = ["serde", "with-actix-web"] } askama_actix = "0.14" sqlx = { version = "0.8", default-features = false, features = [ - "sqlx-sqlite", - "uuid", - "chrono", - "sqlite", - "runtime-tokio", - "macros", - "migrate", + "sqlx-sqlite", + "uuid", + "chrono", + "sqlite", + "runtime-tokio", + "macros", + "migrate", ] } ical = { version = "0.11", features = ["generator", "serde"] } toml = "0.8" @@ -115,9 +120,9 @@ opentelemetry_sdk = { version = "0.26", features = ["rt-tokio"] } opentelemetry-semantic-conventions = "0.26" tracing-opentelemetry = "0.27" tracing-subscriber = { version = "0.3", features = [ - "env-filter", - "fmt", - "registry", + "env-filter", + "fmt", + "registry", ] } rand.workspace = true diff --git a/crates/frontend/Cargo.toml b/crates/frontend/Cargo.toml index d960e5d..c9bd485 100644 --- a/crates/frontend/Cargo.toml +++ b/crates/frontend/Cargo.toml @@ -7,7 +7,7 @@ repository.workspace = true publish = false [dependencies] -askama = { workspace = true } +askama.workspace = true askama_actix = { workspace = true } actix-session = { workspace = true } serde = { workspace = true } diff --git a/crates/frontend/public/assets/style.css b/crates/frontend/public/assets/style.css new file mode 100644 index 0000000..9d23ceb --- /dev/null +++ b/crates/frontend/public/assets/style.css @@ -0,0 +1,3 @@ +body { + font-family: sans-serif; +} diff --git a/crates/frontend/public/templates/layouts/default.html b/crates/frontend/public/templates/layouts/default.html index c86b464..0c6bec1 100644 --- a/crates/frontend/public/templates/layouts/default.html +++ b/crates/frontend/public/templates/layouts/default.html @@ -5,6 +5,7 @@ {% block title %}RustiCal{% endblock %} +