review theme
This commit is contained in:
+23
-23
@@ -106,45 +106,45 @@ pub async fn auth(
|
||||
|
||||
pub fn render_password_form(key: &str, filename: &str, error: bool) -> Response {
|
||||
let message = if error {
|
||||
"<p class=\"err\">Incorrect password. Please try again.</p>"
|
||||
"<p class=\"err\">Mot de passe incorrect. Réessayez.</p>"
|
||||
} else {
|
||||
""
|
||||
};
|
||||
let safe_filename = escape_html(filename);
|
||||
let html = format!(
|
||||
r#"<!doctype html>
|
||||
<html lang="en">
|
||||
<html lang="fr">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||
<meta name="referrer" content="no-referrer" />
|
||||
<title>Protected file</title>
|
||||
<title>Fichier protégé</title>
|
||||
<style>
|
||||
* {{ box-sizing: border-box; }}
|
||||
body {{
|
||||
margin: 0; font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
|
||||
background: #0e1013; color: #e7eaf0; min-height: 100vh;
|
||||
background: #fafafa; color: #171717; min-height: 100vh;
|
||||
display: flex; align-items: center; justify-content: center; padding: 16px;
|
||||
}}
|
||||
.card {{
|
||||
width: 100%; max-width: 400px; background: #15181d; border: 1px solid #262b33;
|
||||
border-radius: 14px; padding: 28px; box-shadow: 0 10px 40px rgba(0,0,0,.4);
|
||||
width: 100%; max-width: 400px; background: #ffffff; border: 1px solid #e5e5e5;
|
||||
border-radius: 8px; padding: 28px;
|
||||
}}
|
||||
.brand {{ display: flex; align-items: center; gap: 10px; margin-bottom: 18px; }}
|
||||
.brand img {{ width: 34px; height: 34px; }}
|
||||
.brand span {{ font-size: 15px; font-weight: 650; }}
|
||||
h1 {{ margin: 0 0 6px; font-size: 20px; }}
|
||||
p {{ margin: 0 0 18px; color: #98a1af; font-size: 14px; word-break: break-all; }}
|
||||
.err {{ margin: 0 0 14px; color: #e05555; background: rgba(224,85,85,.08);
|
||||
border: 1px solid rgba(224,85,85,.3); border-radius: 8px; padding: 10px 12px; }}
|
||||
.brand {{ display: flex; align-items: center; gap: 10px; margin-bottom: 20px; }}
|
||||
.brand img {{ width: 32px; height: 32px; }}
|
||||
.brand span {{ font-size: 15px; font-weight: 600; }}
|
||||
h1 {{ margin: 0 0 6px; font-size: 18px; }}
|
||||
p {{ margin: 0 0 18px; color: #737373; font-size: 14px; word-break: break-all; }}
|
||||
.err {{ margin: 0 0 14px; color: #dc2626; background: #fef2f2;
|
||||
border: 1px solid #fecaca; border-radius: 6px; padding: 10px 12px; }}
|
||||
input[type="password"] {{
|
||||
width: 100%; background: #0e1013; border: 1px solid #262b33; color: #e7eaf0;
|
||||
border-radius: 8px; padding: 12px 13px; font-size: 14px; margin-bottom: 12px;
|
||||
width: 100%; background: #ffffff; border: 1px solid #e5e5e5; color: #171717;
|
||||
border-radius: 6px; padding: 11px 12px; font-size: 14px; margin-bottom: 12px;
|
||||
}}
|
||||
input[type="password"]:focus {{ outline: none; border-color: #3f7bf6; }}
|
||||
button {{ width: 100%; font: inherit; cursor: pointer; border: none; border-radius: 8px;
|
||||
padding: 12px 14px; font-size: 14px; font-weight: 600; background: #3f7bf6; color: #fff; }}
|
||||
button:hover {{ background: #2f63d8; }}
|
||||
input[type="password"]:focus {{ outline: none; border-color: #171717; }}
|
||||
button {{ width: 100%; font: inherit; cursor: pointer; border: none; border-radius: 6px;
|
||||
padding: 11px 14px; font-size: 14px; font-weight: 500; background: #171717; color: #fff; }}
|
||||
button:hover {{ background: #0a0a0a; }}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
@@ -153,12 +153,12 @@ pub fn render_password_form(key: &str, filename: &str, error: bool) -> Response
|
||||
<img src="/logo.svg" alt="logo" />
|
||||
<span>File Drop</span>
|
||||
</div>
|
||||
<h1>Protected file</h1>
|
||||
<p>Enter the password to download <strong>{safe_filename}</strong>.</p>
|
||||
<h1>Fichier protégé</h1>
|
||||
<p>Entrez le mot de passe pour télécharger <strong>{safe_filename}</strong>.</p>
|
||||
{message}
|
||||
<form method="post" action="/api/auth/{key}">
|
||||
<input type="password" name="password" placeholder="Password" autofocus autocomplete="off" />
|
||||
<button type="submit">Download</button>
|
||||
<input type="password" name="password" placeholder="Mot de passe" autofocus autocomplete="off" />
|
||||
<button type="submit">Télécharger</button>
|
||||
</form>
|
||||
</main>
|
||||
</body>
|
||||
|
||||
Reference in New Issue
Block a user