{% extends "templates/login.html" %}
{# ORDeC Hub login, styled to match ORDeC's landing page (web/index.html):
same Helvetica/colour palette, red accent, logo and light/dark theme.
Default view: participants enter only the workshop key. The admin view
(username + admin key) shows at /hub/login?admin. The admin_login flag is set
by ORDeCLoginHandler; authentication branches on username presence in
ORDeCWorkshopAuthenticator (see hub/jupyterhub_config.py). #}
{# Hide JupyterHub's Bootstrap navbar and footer for a clean landing look. #}
{% block nav_bar %}{% endblock nav_bar %}
{% block footer %}{% endblock footer %}
{# Apply the saved theme before first paint (shared 'ordecTheme' key, so the
choice carries into the ORDeC app), avoiding a light-to-dark flash.
JupyterHub's darkmode.js (loaded by super()) sets Bootstrap's data-bs-theme
from its own localStorage key or the OS preference, and Bootstrap's dark
theme sets color-scheme: dark, turning form controls dark even when the
ORDeC theme is light. Run after super() to force it to follow ordecTheme,
and keep jupyterhub-bs-theme in sync so darkmode.js's OS-preference
listener does not flip it back. #}
{% block scripts %}
{{ super() }}
{% endblock scripts %}
{% block stylesheet %}
{{ super() }}
{% endblock stylesheet %}
{% block login %}
{{ super() }}
{% endblock login %}
{% block username_input %}
{% if admin_login %}
{% else %}
{# Hidden empty username keeps the guest path and avoids a KeyError in the hub's
login POST handler, which reads data['username'] unconditionally. #}
{% endif %}
{% endblock username_input %}
{% block password_input %}
{% endblock password_input %}
{% block login_container %}
{{ super() }}
{# Relative links so they work under any hub base URL. #}
{% if admin_login %} ← Workshop login {% else %} Admin login → {% endif %}
{% endblock login_container %} {% block script %} {{ super() }} {% endblock script %}