Files
Lycostorrent/app/templates/login.html
2026-03-23 20:59:26 +01:00

233 lines
7.2 KiB
HTML

<!DOCTYPE html>
<html lang="fr">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Lycostorrent - Connexion</title>
<!-- Chargement du thème (en premier pour éviter le flash) -->
<script src="/static/js/theme-loader.js"></script>
<!-- PWA Meta Tags -->
<meta name="theme-color" content="#e63946">
<meta name="description" content="Connexion à Lycostorrent">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
<meta name="apple-mobile-web-app-title" content="Lycostorrent">
<!-- PWA Manifest -->
<link rel="manifest" href="/static/manifest.json">
<!-- Icons -->
<link rel="icon" type="image/png" sizes="192x192" href="/static/icons/icon-192x192.png">
<link rel="apple-touch-icon" href="/static/icons/icon-192x192.png">
<link rel="stylesheet" href="/static/css/style.css">
<link rel="stylesheet" href="/static/css/themes.css">
</head>
<body>
<div class="container">
<!-- Header -->
<header class="header">
<h1>🔐 Lycostorrent</h1>
<p class="subtitle">Connexion requise</p>
</header>
<!-- Formulaire de connexion -->
<div class="login-wrapper">
{% if locked_message %}
<div class="alert alert-warning">
<span class="alert-icon">🔒</span>
<span>{{ locked_message }}</span>
</div>
{% endif %}
{% if error %}
<div class="alert alert-error">
<span class="alert-icon">⚠️</span>
<span>{{ error }}</span>
</div>
{% endif %}
<form method="POST" action="{{ url_for('login') }}{% if request.args.get('next') %}?next={{ request.args.get('next') }}{% endif %}" class="login-form" autocomplete="on">
<!-- Token CSRF -->
<input type="hidden" name="csrf_token" value="{{ csrf_token }}">
<div class="form-group">
<label for="username">Nom d'utilisateur</label>
<input type="text"
id="username"
name="username"
class="form-input"
placeholder="admin"
autocomplete="username"
required
autofocus
{% if locked_message %}disabled{% endif %}>
</div>
<div class="form-group">
<label for="password">Mot de passe</label>
<input type="password"
id="password"
name="password"
class="form-input"
placeholder="••••••••"
autocomplete="current-password"
required
{% if locked_message %}disabled{% endif %}>
</div>
<button type="submit" class="btn-primary btn-login" {% if locked_message %}disabled{% endif %}>
{% if locked_message %}
🔒 Verrouillé
{% else %}
🔐 Se connecter
{% endif %}
</button>
</form>
<div class="login-footer">
<span class="security-badge">🛡️ Connexion sécurisée</span>
</div>
</div>
<!-- Footer -->
<footer class="app-footer">
<span>Lycostorrent</span>
</footer>
</div>
{% if locked_message %}
<script>
// Rafraîchir la page après le délai de verrouillage
setTimeout(() => {
window.location.reload();
}, 10000);
</script>
{% endif %}
<style>
/* Styles spécifiques à la page login - utilise les variables CSS du thème */
.login-wrapper {
max-width: 400px;
margin: 2rem auto;
padding: 2rem;
background: var(--card-bg);
border-radius: 12px;
box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}
.login-form {
display: flex;
flex-direction: column;
gap: 1.25rem;
}
.form-group {
display: flex;
flex-direction: column;
gap: 0.5rem;
}
.form-group label {
color: var(--text-color);
font-weight: 500;
font-size: 0.95rem;
}
.form-input {
width: 100%;
padding: 0.875rem 1rem;
background: var(--bg-color);
border: 2px solid var(--border-color);
border-radius: 8px;
color: var(--text-color);
font-size: 1rem;
transition: border-color 0.2s, box-shadow 0.2s;
box-sizing: border-box;
}
.form-input:focus {
outline: none;
border-color: var(--accent-color);
box-shadow: 0 0 0 3px rgba(230, 57, 70, 0.2);
}
.form-input::placeholder {
color: var(--text-muted);
}
.form-input:disabled {
opacity: 0.5;
cursor: not-allowed;
}
.btn-login {
width: 100%;
padding: 1rem;
font-size: 1rem;
font-weight: 600;
margin-top: 0.5rem;
}
.btn-login:disabled {
background: var(--text-muted);
cursor: not-allowed;
}
.alert {
display: flex;
align-items: center;
gap: 0.75rem;
padding: 1rem;
border-radius: 8px;
margin-bottom: 1.5rem;
font-size: 0.95rem;
}
.alert-icon {
font-size: 1.25rem;
}
.alert-error {
background: rgba(239, 68, 68, 0.15);
border: 1px solid rgba(239, 68, 68, 0.3);
color: #ef4444;
}
.alert-warning {
background: rgba(245, 158, 11, 0.15);
border: 1px solid rgba(245, 158, 11, 0.3);
color: #f59e0b;
}
.login-footer {
margin-top: 1.5rem;
padding-top: 1.5rem;
border-top: 1px solid var(--border-color);
text-align: center;
}
.security-badge {
display: inline-flex;
align-items: center;
gap: 0.5rem;
background: rgba(34, 197, 94, 0.15);
color: #22c55e;
padding: 0.5rem 1rem;
border-radius: 20px;
font-size: 0.85rem;
font-weight: 500;
}
@media (max-width: 480px) {
.login-wrapper {
margin: 1rem;
padding: 1.5rem;
}
}
</style>
</body>
</html>