{% extends "layout.html" %}
{% block head %}
<{ legacy_asset_tags JS_AUTH_ASSETS CSS_ASSETS }/>
{% endblock %}
{% block body_tag %}<body class="auth-page">{% endblock %}
{% block content %}
  <div id="auth-container" {% if app.config['AUTH_BACKGROUND'] %}style="background: {{app.config['AUTH_BACKGROUND']}}"{% endif %}>
    <a href="{{url_for('index')}}">
      <img
      srcset="{{ url_for_static('assets/navbar-logo-black.png') }},
              {{ url_for_static('assets/navbar-logo-black1.5x.png') }} 1.5x,
              {{ url_for_static('assets/navbar-logo-black2x.png') }} 2x"
      src="{{ url_for_static('assets/navbar-logo-black.png') }}" alt="{{app.config['TITLE']}}">
      {% if app.config['AUTH_PAGE_LOGO'] %}<img src="{{app.config['AUTH_PAGE_LOGO']}}" alt="">{% endif %}
    </a>
    <div class="nav">
      {% block users_nav %}
      {% if not current_user.is_authenticated %}
      <a class="nav-link" href="{{url_for('users.login')}}">{{_('Login')}}</a>
      <a class="nav-link" href="{{url_for('users.signup')}}">{{_('Signup')}}</a>
      {% else %}
      <a class="nav-link" href="{{url_for('users.logout')}}">{{_('Logout')}}</a>
      {% endif %}
      {% endblock %}
    </div>
    <div id="auth-form-panel">
      {% flash_messages %}
        <div class="alert alert-{{ category }}" role="alert">
          {{ message }}
        </div>
      {% endflash %}
      <div class="content">
        {% block users_content %}{% endblock %}
      </div>
      <div class="links">
        <span><a href="https://kantree.io">Kantree.io</a></span>
        {% if app.config['TERMS_URL'] %}
        <span><a href="{{get_localized_config_value(app.config['TERMS_URL'])}}" target="_blank">{{_("Terms of Service")}}</a></span>
        {% endif %}
        {% if app.config['PRIVACY_URL'] %}
        <span><a href="{{get_localized_config_value(app.config['PRIVACY_URL'])}}" target="_blank">{{_("Privacy Policy")}}</a></span>
        {% endif %}
        <span class="lang">
          <i class="fa fa-globe"></i>
          <select onchange="document.location = event.target.value" class="form-select form-select-inline ms-2">
            {% for lang, name in available_locales() %}
            <option value="{{url_for(request.endpoint, **dict(request.view_args or {}, locale=lang))}}" {% if g.current_locale == lang %}selected{% endif %}>{{name}}</option>
            {% endfor %}
          </select>
        </span>
        {% if app.extensions.frasco_users.options['hcaptcha_key'] %}
        <br>
        {{_('This site is protected by hCaptcha and its <a href="https://hcaptcha.com/privacy">Privacy Policy</a> and <a href="https://hcaptcha.com/terms">Terms of Service</a> apply.')|safe}}
        {% endif %}
      </div>
    </div>
  </div>
{% endblock %}
