diff --git a/Cargo.lock b/Cargo.lock index 00886f8..fc63227 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -385,59 +385,44 @@ dependencies = [ [[package]] name = "askama" -version = "0.12.1" +version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b79091df18a97caea757e28cd2d5fda49c6cd4bd01ddffd7ff01ace0c0ad2c28" +checksum = "9a4e46abb203e00ef226442d452769233142bbfdd79c3941e84c8e61c4112543" dependencies = [ "askama_derive", - "askama_escape", - "humansize", - "num-traits", + "itoa", "percent-encoding", "serde", "serde_json", - "serde_yaml", -] - -[[package]] -name = "askama_actix" -version = "0.14.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e4b0dd17cfe203b00ba3853a89fba459ecf24c759b738b244133330607c78e55" -dependencies = [ - "actix-web", - "askama", ] [[package]] name = "askama_derive" -version = "0.12.5" +version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "19fe8d6cb13c4714962c072ea496f3392015f0989b1a2847bb4b2d9effd71d83" +checksum = "54398906821fd32c728135f7b351f0c7494ab95ae421d41b6f5a020e158f28a6" dependencies = [ "askama_parser", "basic-toml", - "mime", - "mime_guess", + "memchr", "proc-macro2", "quote", + "rustc-hash", "serde", + "serde_derive", "syn", ] -[[package]] -name = "askama_escape" -version = "0.10.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "619743e34b5ba4e9703bba34deac3427c72507c7159f5fd030aea8cac0cfe341" - [[package]] name = "askama_parser" -version = "0.2.1" +version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "acb1161c6b64d1c3d83108213c2a2533a342ac225aabd0bda218278c2ddb00c0" +checksum = "cf315ce6524c857bb129ff794935cf6d42c82a6cff60526fe2a63593de4d0d4f" dependencies = [ - "nom", + "memchr", + "serde", + "serde_derive", + "winnow", ] [[package]] @@ -1396,15 +1381,6 @@ version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "df3b46402a9d5adb4c86a0cf463f42e19994e3ee891101b1841f30a545cb49a9" -[[package]] -name = "humansize" -version = "2.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6cb51c9a029ddc91b07a787f1d86b53ccfa49b0e86688c946ebe8d3555685dd7" -dependencies = [ - "libm", -] - [[package]] name = "hyper" version = "1.6.0" @@ -1844,12 +1820,6 @@ dependencies = [ "unicase", ] -[[package]] -name = "minimal-lexical" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" - [[package]] name = "miniz_oxide" version = "0.8.7" @@ -1877,16 +1847,6 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e94e1e6445d314f972ff7395df2de295fe51b71821694f0b0e1e79c4f12c8577" -[[package]] -name = "nom" -version = "7.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d273983c5a657a70a3e8f2a01329822f3b8c8172b73826411a55751e404a0a4a" -dependencies = [ - "memchr", - "minimal-lexical", -] - [[package]] name = "nu-ansi-term" version = "0.46.0" @@ -2868,7 +2828,6 @@ dependencies = [ "actix-session", "actix-web", "askama", - "askama_actix", "futures-core", "hex", "mime_guess", @@ -2886,7 +2845,6 @@ dependencies = [ "actix-session", "actix-web", "askama", - "askama_actix", "chrono", "futures-core", "hex", @@ -3096,19 +3054,6 @@ 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", - "itoa", - "ryu", - "serde", - "unsafe-libyaml", -] - [[package]] name = "sha1" version = "0.10.6" @@ -3901,12 +3846,6 @@ dependencies = [ "subtle", ] -[[package]] -name = "unsafe-libyaml" -version = "0.2.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "673aac59facbab8a9007c7f6108d11f63b603f7cabff99fabf650fea5c32b861" - [[package]] name = "untrusted" version = "0.9.0" diff --git a/Cargo.toml b/Cargo.toml index 5278f75..2d21899 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -73,13 +73,7 @@ derive_more = { version = "2.0", features = [ "deref", "constructor", ] } -askama = { version = "0.12", features = [ - "serde", - "with-actix-web", - "serde-json", - "serde-yaml", -] } -askama_actix = "0.14" +askama = { version = "0.13", features = ["serde_json"] } sqlx = { version = "0.8", default-features = false, features = [ "sqlx-sqlite", "uuid", diff --git a/crates/frontend/Cargo.toml b/crates/frontend/Cargo.toml index 842a90a..d9be442 100644 --- a/crates/frontend/Cargo.toml +++ b/crates/frontend/Cargo.toml @@ -8,7 +8,6 @@ publish = false [dependencies] askama.workspace = true -askama_actix = { workspace = true } actix-session = { workspace = true } serde = { workspace = true } thiserror = { workspace = true } diff --git a/crates/frontend/public/templates/pages/addressbook.html b/crates/frontend/public/templates/pages/addressbook.html index f956a9e..9673939 100644 --- a/crates/frontend/public/templates/pages/addressbook.html +++ b/crates/frontend/public/templates/pages/addressbook.html @@ -8,7 +8,7 @@
{{ description }}
{% endif%} -{{ addressbook|yaml }}
+{{ addressbook|json }}
Back
{% endblock %}
diff --git a/crates/frontend/public/templates/pages/calendar.html b/crates/frontend/public/templates/pages/calendar.html
index 832471c..d044145 100644
--- a/crates/frontend/public/templates/pages/calendar.html
+++ b/crates/frontend/public/templates/pages/calendar.html
@@ -8,7 +8,7 @@
{{ description }}
{% endif%} -{{ calendar|yaml }}
+{{ calendar|json }}
Back
{% endblock %}
diff --git a/crates/frontend/src/lib.rs b/crates/frontend/src/lib.rs
index a835772..5a45bd2 100644
--- a/crates/frontend/src/lib.rs
+++ b/crates/frontend/src/lib.rs
@@ -6,11 +6,10 @@ use actix_web::{
dev::ServiceResponse,
http::{Method, StatusCode},
middleware::{ErrorHandlerResponse, ErrorHandlers},
- web::{self, Data, Path},
+ web::{self, Data, Html, Path},
HttpRequest, HttpResponse, Responder,
};
use askama::Template;
-use askama_actix::TemplateToResponse;
use assets::{Assets, EmbedService};
use routes::{
addressbook::{route_addressbook, route_addressbook_restore},
@@ -44,6 +43,7 @@ async fn route_user