From 3ab595abd2f7508f5ace5035a19991078d17b978 Mon Sep 17 00:00:00 2001 From: Greg Shuflin Date: Mon, 3 Feb 2025 16:01:34 -0800 Subject: [PATCH] Demo notice --- src/main.rs | 4 +--- static/css/style.css | 12 ++---------- templates/login.html.tera | 18 +++++++++--------- 3 files changed, 12 insertions(+), 22 deletions(-) diff --git a/src/main.rs b/src/main.rs index 373b1ba..9533c02 100644 --- a/src/main.rs +++ b/src/main.rs @@ -12,7 +12,6 @@ mod user; use rocket::fairing::{self, AdHoc}; use rocket::fs::FileServer; use rocket::response::Redirect; -use rocket::State; use rocket::{Build, Rocket}; use rocket_db_pools::{sqlx, Connection, Database}; use rocket_dyn_templates::{context, Template}; @@ -59,8 +58,7 @@ async fn index_redirect(mut db: Connection) -> Redirect { #[get("/login")] fn login(demo_mode: &State) -> Template { - let demo_mode: bool = **demo_mode; - Template::render("login", context! { demo_mode: demo_mode }) + Template::render("login", context! { demo_mode: *demo_mode }) } // Run migrations and setup demo data if needed diff --git a/static/css/style.css b/static/css/style.css index ff414f0..785f9f7 100644 --- a/static/css/style.css +++ b/static/css/style.css @@ -537,7 +537,6 @@ button:disabled { } .demo-notice { - background-color: #f8f9fa; border: 1px solid #dee2e6; border-radius: 4px; padding: 1rem; @@ -545,19 +544,12 @@ button:disabled { text-align: center; } -.demo-notice h2 { - color: #0d6efd; - margin-top: 0; - margin-bottom: 1rem; -} - .demo-notice p { margin: 0.5rem 0; } .demo-notice pre { - background-color: #e9ecef; - padding: 0.2rem 0.4rem; - border-radius: 3px; + padding: 0.1rem 0.4rem; + border-radius: 2px; font-family: monospace; } diff --git a/templates/login.html.tera b/templates/login.html.tera index 39b1109..5c0847c 100644 --- a/templates/login.html.tera +++ b/templates/login.html.tera @@ -7,17 +7,17 @@