{% extends "insight_ui/base.html" %} {% load i18n insight_tags %} {% comment %} Login Template - Context Contract ================================= Required context variables: form - Django form with credential fields. Supports both: - Django auth: form.username, form.password - django-allauth: form.login, form.password app_path - Form action URL (e.g., reverse('login')) Optional context variables: login_config - LoginScreenConfig instance with: - logo: LogoConfig for branding - show_theme_toggle: bool (default: True) - show_labels: bool (default: False) - forgot_password_url: str for password reset link - alt_login_url: str for alternative login (e.g., SSO) - alt_login_title: str for alternative login button text - sign_up_url: str for registration link footer_config - FooterConfig instance for page footer {% endcomment %} {% block content %}
{% if login_config.show_theme_toggle %}
{% include "insight_ui/components/toggle_theme.html" %}
{% endif %} {% if login_config.logo %} {% endif %}

{% trans "Login" %}

{% csrf_token %}
{{ form.non_field_errors }}
{% with credential_field=form.login|default:form.username %}
{% if login_config.show_labels %} {% endif %} {{ credential_field.errors }}
{% endwith %}
{% if login_config.show_labels %} {% endif %} {{ form.password.errors }} {% if login_config.forgot_password_url %} {% endif %}
{% button label=_("Sign in") type="primary" button_type="submit" extra_classes="w-full" %}
{% if login_config.alt_login_url %}
{% trans "Or" %}
{% endif %} {% if login_config.sign_up_url %}

{% trans "You do not have an account yet?" %}

{% trans "Sign up here" %}
{% endif %}
{% endblock %} {% block footer %} {% footer config=footer_config %} {% endblock footer %}