{# -*- coding: utf-8 -*-

  This file is part of Invenio.
  Copyright (C) 2015-2020 CERN.
  Copyright (C)      2021 TU Wien.
  Copyright (C)      2021 Graz University of Technology.

  Invenio is free software; you can redistribute it and/or modify it
  under the terms of the MIT License; see LICENSE file for more details.
#}
{%- extends config.OAUTHCLIENT_LOGIN_USER_TEMPLATE_PARENT %}

{%- from "invenio_oauthclient/_macros.html" import oauth_button %}


{%- block form_outer %}
  {% if config.OAUTHCLIENT_REMOTE_APPS %}
  <div class="ui form">
    {% for name, config in config.OAUTHCLIENT_REMOTE_APPS.items() if not config.hide %}
      {{ oauth_button(name, next=request.args.get('next')) }}
    {% endfor %}
  </div>

    {%- if config.ACCOUNTS_LOCAL_LOGIN_ENABLED %}
      <div class="ui horizontal divider">
        {{ _("Or") }}
      </div>
    {%- endif %}
  {% endif %}
  {{ super () }}
{% endblock %}

{%- block recoverable %}
  {%- if security.recoverable or security.confirmable %}
  <div class="ui one column centered grid">
    {%- if security.recoverable %}
    <div class="row">
      <a class="ui inverted header tiny"
          href="{{ url_for_security('forgot_password') }}">{{ _('Forgot password?') }}</a>
    </div>
    {%- endif %}
    {%- if security.confirmable %}
    <div class="row">
      <a class="ui inverted header tiny"
        href="{{url_for('security.send_confirmation')}}" class="text-muted">{{_('Resend confirmation email')}}</a>
    </div>
    {%- endif %}
  </div>
  {%- endif %}
{%- endblock %}
