DockFlare/dockflare/app/templates/login.html
2025-09-26 13:40:37 +02:00

69 lines
No EOL
3.1 KiB
HTML

<!DOCTYPE html>
<html lang="en" data-theme="light">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Login - DockFlare</title>
<link href="{{ url_for('static', filename='css/output.css') }}" rel="stylesheet">
</head>
<body class="bg-base-200 flex items-center justify-center h-screen">
<div class="card w-96 bg-base-100 shadow-xl">
<div class="card-body">
<h2 class="card-title">DockFlare Login</h2>
{% with messages = get_flashed_messages(with_categories=true) %}
{% if messages %}
{% for category, message in messages %}
<div class="alert alert-{{ category if category in ['error', 'success', 'warning', 'info'] else 'info' }} mt-4">
<span>{{ message }}</span>
</div>
{% endfor %}
{% endif %}
{% endwith %}
{% if oauth_providers %}
<div class="flex flex-col w-full border-opacity-50">
{% for provider in oauth_providers %}
<a href="{{ url_for('web.login_provider', provider_id=provider.id) }}" class="btn btn-outline mb-2">
Login with {{ provider.name }}
</a>
{% endfor %}
{% if password_login_enabled %}
<div class="divider">OR</div>
{% endif %}
</div>
{% endif %}
{% if password_login_enabled %}
<form method="POST" action="{{ url_for('web.login') }}">
{% if form %}{{ form.hidden_tag() }}{% endif %}
<div class="form-control">
{% if form %}
{{ form.username.label(class="label") }}
{{ form.username(class="input input-bordered", placeholder="Username") }}
{% else %}
<label class="label">Username</label>
<input type="text" name="username" class="input input-bordered" placeholder="Username" required>
{% endif %}
</div>
<div class="form-control">
{% if form %}
{{ form.password.label(class="label") }}
{{ form.password(class="input input-bordered", placeholder="Password") }}
{% else %}
<label class="label">Password</label>
<input type="password" name="password" class="input input-bordered" placeholder="Password" required>
{% endif %}
</div>
<div class="form-control mt-6">
{% if form %}
{{ form.submit(class="btn btn-primary") }}
{% else %}
<input type="submit" value="Login" class="btn btn-primary">
{% endif %}
</div>
</form>
{% endif %}
</div>
</div>
</body>
</html>