add privacy page
This commit is contained in:
82
src/index.rs
82
src/index.rs
@@ -1,7 +1,7 @@
|
||||
use crate::{language::language, page::Page};
|
||||
use axum::http::HeaderMap;
|
||||
use axum_extra::extract::CookieJar;
|
||||
use maud::{Markup, PreEscaped, html};
|
||||
use maud::{html, Markup, PreEscaped};
|
||||
|
||||
pub(super) async fn index(cookies: CookieJar, headers: HeaderMap) -> Markup {
|
||||
let lang = language(&cookies, &headers);
|
||||
@@ -53,3 +53,83 @@ pub(super) async fn index(cookies: CookieJar, headers: HeaderMap) -> Markup {
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
pub(super) async fn data(cookies: CookieJar, headers: HeaderMap) -> Markup {
|
||||
let lang = language(&cookies, &headers);
|
||||
rust_i18n::set_locale(lang.to_locale());
|
||||
|
||||
let page = Page::new(lang);
|
||||
page.content(html! {
|
||||
h1 { (t!("privacy_policy_title")) }
|
||||
h2 { (t!("data_controller")) }
|
||||
p {
|
||||
a href="https://www.digidow.eu/impressum/" target="_blank" { (t!("see_impressum")) }
|
||||
}
|
||||
h2 { (t!("overview")) }
|
||||
p {
|
||||
(PreEscaped(t!("privacy_overview")))
|
||||
}
|
||||
h2 { (t!("data_we_collect")) }
|
||||
h3 { (t!("cookies")) }
|
||||
p {
|
||||
(t!("cookies_description"))
|
||||
ol {
|
||||
li {
|
||||
kbd { "client_id" }
|
||||
" "
|
||||
(t!("cookie_client_id"))
|
||||
}
|
||||
li {
|
||||
kbd { "lang" }
|
||||
" "
|
||||
(t!("cookie_lang"))
|
||||
}
|
||||
}
|
||||
}
|
||||
h3 { (t!("game_data")) }
|
||||
p {
|
||||
(t!("game_data_description"))
|
||||
ul {
|
||||
li { (t!("chosen_name")) }
|
||||
li { (t!("game_progress")) }
|
||||
li {
|
||||
(PreEscaped(t!("random_client_id")))
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
h2 { (t!("purpose_legal_basis")) }
|
||||
ul {
|
||||
li { (t!("game_functionality")) }
|
||||
li { (t!("language_preference")) }
|
||||
}
|
||||
h2 { (t!("data_retention")) }
|
||||
p {
|
||||
(t!("data_retention_description"))
|
||||
}
|
||||
h2 { (t!("data_sharing")) }
|
||||
p {
|
||||
(t!("data_sharing_description"))
|
||||
}
|
||||
h2 { (t!("your_rights_gdpr")) }
|
||||
p {
|
||||
(t!("rights_description"))
|
||||
ul {
|
||||
li { (t!("right_access")) }
|
||||
li { (t!("right_rectification")) }
|
||||
li { (t!("right_erasure")) }
|
||||
li { (t!("right_restriction")) }
|
||||
li { (t!("right_portability")) }
|
||||
li { (t!("right_object")) }
|
||||
li { (t!("right_withdraw_consent")) }
|
||||
}
|
||||
}
|
||||
h3 { (t!("how_to_exercise_rights")) }
|
||||
ul {
|
||||
li { (t!("clear_cookies")) }
|
||||
li {
|
||||
(PreEscaped(t!("contact_us")))
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
|
@@ -1,11 +1,11 @@
|
||||
use crate::model::client::Client;
|
||||
use axum::{Router, http::HeaderMap, routing::get};
|
||||
use axum::{http::HeaderMap, routing::get, Router};
|
||||
use axum_extra::extract::{
|
||||
CookieJar, PrivateCookieJar,
|
||||
cookie::{Cookie, Expiration, Key},
|
||||
CookieJar, PrivateCookieJar,
|
||||
};
|
||||
use serde::{Deserialize, Serialize};
|
||||
use sqlx::{SqlitePool, pool::PoolOptions, sqlite::SqliteConnectOptions};
|
||||
use sqlx::{pool::PoolOptions, sqlite::SqliteConnectOptions, SqlitePool};
|
||||
use std::{
|
||||
collections::HashSet,
|
||||
fmt::Display,
|
||||
@@ -16,7 +16,7 @@ use std::{
|
||||
};
|
||||
use time::{Duration, OffsetDateTime};
|
||||
use tower_http::services::ServeDir;
|
||||
use tracing_subscriber::{EnvFilter, layer::SubscriberExt, util::SubscriberInitExt};
|
||||
use tracing_subscriber::{layer::SubscriberExt, util::SubscriberInitExt, EnvFilter};
|
||||
use uuid::Uuid;
|
||||
|
||||
#[macro_use]
|
||||
@@ -278,6 +278,7 @@ async fn main() {
|
||||
|
||||
let app = Router::new()
|
||||
.route("/", get(index::index))
|
||||
.route("/privacy", get(index::data))
|
||||
.nest_service("/static", ServeDir::new("./static/serve"))
|
||||
.merge(game::routes())
|
||||
.with_state(state);
|
||||
|
@@ -1,5 +1,5 @@
|
||||
use crate::Language;
|
||||
use maud::{DOCTYPE, Markup, html};
|
||||
use maud::{html, Markup, DOCTYPE};
|
||||
|
||||
pub(crate) struct Page {
|
||||
lang: Language,
|
||||
@@ -104,9 +104,7 @@ impl Page {
|
||||
|
||||
footer.container {
|
||||
small {
|
||||
(t!("footer_text"))
|
||||
mark { (t!("footer_todo")) }
|
||||
a href="#" { (t!("footer_links")) }
|
||||
a href="/privacy" { (t!("privacy_policy")) }
|
||||
" • "
|
||||
a target="_blank" href="https://www.digidow.eu/impressum/" {
|
||||
(t!("impressum"))
|
||||
|
Reference in New Issue
Block a user