{# _auth_main_register.html — registration form column. Renders
standalone for HTMX fragment responses. Expected context: csrf_token, email, username, error, client_id, app_name, custom_fields, custom_values, is_production #} {% import "_partials/_auth_macros.html" as auth %} {%- if client_id -%} {%- set login_href = "/login?client_id=" ~ client_id -%} {%- else -%} {%- set login_href = "/login" -%} {%- endif -%} {%- if signup_url -%} {%- set register_href = signup_url -%} {%- elif client_id -%} {%- set register_href = "/register?client_id=" ~ client_id -%} {%- else -%} {%- set register_href = "/register" -%} {%- endif -%}
{{ auth.kicker(app_name, "Create account", swap_href=login_href, swap_label="Sign in", swap_prefix="") }}

{% if registration_disabled %}Registration disabled{% elif token %}Accept invitation{% else %}Create account{% endif %}

{% if registration_disabled %} Ask an admin for an invitation link. {% elif token %} Finish creating your account. {% else %} Let's get you set up. {% endif %}

{{ auth.tabs(active="signup", signup_href=register_href) }}
{% if error %} {% set flash = { "kind": "err", "message": error } %}
{% include "_partials/_flash.html" %}
{% endif %} {% if not registration_disabled %}
{% if token %}{% endif %}
{% if custom_fields %} {% for field in custom_fields %} {% if field.field_type == "checkbox" %} {% elif field.field_type == "textarea" %}
{% if field.help_text %}
{{ field.help_text }}
{% endif %}
{% elif field.field_type == "select" %}
{% if field.help_text %}
{{ field.help_text }}
{% endif %}
{% elif field.field_type == "number" %}
{% if field.help_text %}
{{ field.help_text }}
{% endif %}
{% else %}
{% if field.help_text %}
{{ field.help_text }}
{% endif %}
{% endif %} {% endfor %} {% endif %}
{{ auth.oauth_grid(oauth_providers) }} {{ auth.terms_footer() }} {% else %} {% endif %}