{% extends 'hidp/base_post_login.html' %}
{% load i18n %}

{% block title %}{% translate 'Set a password' %}{% endblock %}

{% block main %}
  <h1>{% translate 'Set a password' %}</h1>

  {% if must_reauthenticate %}
    <p>{% translate 'For your security, you need to re-authenticate via a linked service before you can set a password.' %}</p>

    <h2>{% translate 'Linked services' %}</h2>

    {% if oidc_linked_providers %}
      {% include 'hidp/includes/federated/oidc_provider_list.html' with providers=oidc_linked_providers next_url=auth_next_url %}
    {% else %}
      <p>{% translate 'However, your account is not currently linked to any service, so you cannot set a password at this time.' %}</p>
    {% endif %}

    {% include 'hidp/includes/forms/submit_row.html' with cancel_url=cancel_url %}

  {% else %}
    <p>
      {% translate 'Add a password to your account. This will allow you to sign in using your email address and password as well as any linked services.' %}
    </p>

    <form method="post">
      {% csrf_token %}
      {{ form }}
      {% include 'hidp/includes/forms/submit_row.html' with submit_label=_('Save') cancel_url=cancel_url %}
    </form>

  {% endif %}
{% endblock %}
