Files
fitguide/app/templates/login.html
T

56 lines
2.0 KiB
HTML

{% extends "base.html" %}
{% block title %}Sign in · {{ app_name }}{% endblock %}
{% block body %}
<div class="auth-shell">
<div class="card auth-card">
<h1>{{ app_name }}</h1>
<p class="muted">Sign in to continue</p>
{% if ldap_enabled %}
<form method="post" action="/login/ldap">
<input type="hidden" name="next" value="{{ next_url or '' }}">
{% if ldap_error %}<div class="alert">{{ ldap_error }}</div>{% endif %}
<label>Username
<input type="text" name="username" value="{{ username or '' }}" required autofocus>
</label>
<label>Password
<input type="password" name="password" required>
</label>
<button type="submit" class="btn btn-primary">Sign in</button>
</form>
<details class="local-login-panel" {% if local_error %}open{% endif %}>
<summary>Use a local account instead</summary>
<form method="post" action="/login">
<input type="hidden" name="next" value="{{ next_url or '' }}">
{% if local_error %}<div class="alert">{{ local_error }}</div>{% endif %}
<label>Email
<input type="email" name="email" value="{{ email or '' }}" required>
</label>
<label>Password
<input type="password" name="password" required>
</label>
<button type="submit" class="btn btn-primary">Sign in with local account</button>
</form>
</details>
{% else %}
<form method="post" action="/login">
<input type="hidden" name="next" value="{{ next_url or '' }}">
{% if local_error %}<div class="alert">{{ local_error }}</div>{% endif %}
<label>Email
<input type="email" name="email" value="{{ email or '' }}" required autofocus>
</label>
<label>Password
<input type="password" name="password" required>
</label>
<button type="submit" class="btn btn-primary">Sign in</button>
</form>
{% endif %}
</div>
</div>
{% endblock %}