Demo notice
This commit is contained in:
parent
4c44767301
commit
3ab595abd2
@ -12,7 +12,6 @@ mod user;
|
|||||||
use rocket::fairing::{self, AdHoc};
|
use rocket::fairing::{self, AdHoc};
|
||||||
use rocket::fs::FileServer;
|
use rocket::fs::FileServer;
|
||||||
use rocket::response::Redirect;
|
use rocket::response::Redirect;
|
||||||
use rocket::State;
|
|
||||||
use rocket::{Build, Rocket};
|
use rocket::{Build, Rocket};
|
||||||
use rocket_db_pools::{sqlx, Connection, Database};
|
use rocket_db_pools::{sqlx, Connection, Database};
|
||||||
use rocket_dyn_templates::{context, Template};
|
use rocket_dyn_templates::{context, Template};
|
||||||
@ -59,8 +58,7 @@ async fn index_redirect(mut db: Connection<Db>) -> Redirect {
|
|||||||
|
|
||||||
#[get("/login")]
|
#[get("/login")]
|
||||||
fn login(demo_mode: &State<bool>) -> Template {
|
fn login(demo_mode: &State<bool>) -> 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
|
// Run migrations and setup demo data if needed
|
||||||
|
@ -537,7 +537,6 @@ button:disabled {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.demo-notice {
|
.demo-notice {
|
||||||
background-color: #f8f9fa;
|
|
||||||
border: 1px solid #dee2e6;
|
border: 1px solid #dee2e6;
|
||||||
border-radius: 4px;
|
border-radius: 4px;
|
||||||
padding: 1rem;
|
padding: 1rem;
|
||||||
@ -545,19 +544,12 @@ button:disabled {
|
|||||||
text-align: center;
|
text-align: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
.demo-notice h2 {
|
|
||||||
color: #0d6efd;
|
|
||||||
margin-top: 0;
|
|
||||||
margin-bottom: 1rem;
|
|
||||||
}
|
|
||||||
|
|
||||||
.demo-notice p {
|
.demo-notice p {
|
||||||
margin: 0.5rem 0;
|
margin: 0.5rem 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.demo-notice pre {
|
.demo-notice pre {
|
||||||
background-color: #e9ecef;
|
padding: 0.1rem 0.4rem;
|
||||||
padding: 0.2rem 0.4rem;
|
border-radius: 2px;
|
||||||
border-radius: 3px;
|
|
||||||
font-family: monospace;
|
font-family: monospace;
|
||||||
}
|
}
|
||||||
|
@ -7,17 +7,17 @@
|
|||||||
<link rel="stylesheet" href="/static/css/style.css">
|
<link rel="stylesheet" href="/static/css/style.css">
|
||||||
</head>
|
</head>
|
||||||
<div class="login-container">
|
<div class="login-container">
|
||||||
{% if demo_mode %}
|
|
||||||
<div class="demo-notice">
|
|
||||||
<h2>Demo Mode</h2>
|
|
||||||
<p>RSS Reader is currently running in demo mode. You can log in with these credentials:</p>
|
|
||||||
<p>Username: <pre style="display: inline">demo</pre></p>
|
|
||||||
<p>Password: <pre style="display: inline">demo</pre></p>
|
|
||||||
<p>Note: Any data you create will not be persisted after the application restarts.</p>
|
|
||||||
</div>
|
|
||||||
{% endif %}
|
|
||||||
<form class="login-form" id="loginForm">
|
<form class="login-form" id="loginForm">
|
||||||
<h1>Login</h1>
|
<h1>Login</h1>
|
||||||
|
{% if demo_mode %}
|
||||||
|
<div class="demo-notice">
|
||||||
|
<p>RSS Reader is currently running in demo mode. You can log in with these credentials:</p>
|
||||||
|
|
||||||
|
Username: <pre style="display: inline">demo</pre>, Password: <pre style="display: inline">demo</pre>
|
||||||
|
|
||||||
|
<p>Note: Any data you create will not be persisted after the application restarts.</p>
|
||||||
|
</div>
|
||||||
|
{% endif %}
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label for="username">Username</label>
|
<label for="username">Username</label>
|
||||||
<input type="text" id="username" name="username" required>
|
<input type="text" id="username" name="username" required>
|
||||||
|
Loading…
Reference in New Issue
Block a user