{# Copyright 2024 New Vector Ltd. Copyright 2022-2024 The Matrix.org Foundation C.I.C. SPDX-License-Identifier: AGPL-3.0-only Please see LICENSE in the repository root for full details. -#} {% extends "base.html" %} {% from "components/idp_brand.html" import logo %} {% block content %} {% if force_localpart %}
{{ icon.download() }}

{{ _("mas.upstream_oauth2.register.import_data.heading") }}

{{ _("mas.upstream_oauth2.register.import_data.description", server_name=branding.server_name) }}

{% elif upstream_oauth_provider.human_name %}
{{ icon.user_profile_solid() }}

{{ _("mas.upstream_oauth2.register.signup_with_upstream.heading", human_name=upstream_oauth_provider.human_name) }}

{% else %}
{{ icon.mention() }}

{{ _("mas.upstream_oauth2.register.choose_username.heading") }}

{{ _("mas.upstream_oauth2.register.choose_username.description") }}

{% endif %} {% if upstream_oauth_provider.human_name %}
{% if upstream_oauth_provider.brand_name %} {{ logo(brand=upstream_oauth_provider.brand_name, class="brand") }} {% else %} {{ icon.user_profile() }} {% endif %}

{{- _("mas.upstream_oauth2.register.provider_name", human_name=upstream_oauth_provider.human_name) -}}

{% if upstream_oauth_link.human_account_name %} {% endif %}
{% endif %}
{% if form_state.errors is not empty %} {% for error in form_state.errors %}
{{- errors.form_error_message(error=error) -}}
{% endfor %} {% endif %} {% if force_localpart %} {% call(f) field.field(label=_("common.mxid"), name="mxid") %}
{{- _("mas.upstream_oauth2.register.enforced_by_policy") -}}
{% endcall %} {% else %} {% call(f) field.field(label=_("common.username"), name="username", form_state=form_state) %} {% if f.errors is empty %}
@{{ imported_localpart or (_("common.username") | lower) }}:{{ branding.server_name }}
{% endif %} {% endcall %} {% endif %} {% if imported_email %}
{% call(f) field.field(label=_("common.email_address"), name="email", class="flex-1") %}
{% if upstream_oauth_provider.human_name %} {{- _("mas.upstream_oauth2.register.imported_from_upstream_with_name", human_name=upstream_oauth_provider.human_name) -}} {% else %} {{- _("mas.upstream_oauth2.register.imported_from_upstream") -}} {% endif %}
{% endcall %} {% if not force_email %}
{{ icon.check() }}
{% endif %}
{% endif %} {% if imported_display_name %}
{% call(f) field.field(label=_("common.display_name"), name="display_name", class="flex-1") %}
{% if upstream_oauth_provider.human_name %} {{- _("mas.upstream_oauth2.register.imported_from_upstream_with_name", human_name=upstream_oauth_provider.human_name) -}} {% else %} {{- _("mas.upstream_oauth2.register.imported_from_upstream") -}} {% endif %}
{% endcall %} {% if not force_display_name %}
{{ icon.check() }}
{% endif %}
{% endif %} {% if branding.tos_uri %} {% call(f) field.field(label=_("mas.register.terms_of_service", tos_uri=branding.tos_uri), name="accept_terms", form_state=form_state, inline=true, class="my-4") %}
{{ icon.check() }}
{% endcall %} {% endif %} {{ button.button(text=_("action.create_account")) }}
{# Leave this for now as we don't have that fully designed yet {{ field.separator() }} {{ button.link_outline(text=_("mas.upstream_oauth2.register.link_existing"), href=login_link) }} #} {% endblock content %}