<script type='text/javascript' src='{{"/js/jquery.validate.min.js"|media}}'></script>
<script type="text/javascript" src="{{"/jquery-openid/jquery.openid.js"|media}}"></script>
<script type="text/javascript">
    var extra_token_name = {};
    var create_pw_text = {};
    var change_pw_text = {};
    var authUrl = '/{% trans %}account/{% endtrans %}';
    var siteName = '{{settings.APP_SHORT_NAME}}';
    var provider_count = {{existing_login_methods|length}};
    {% for login_provider in major_login_providers %}
        {%if settings['SIGNIN_' + login_provider.name.upper() + '_ENABLED'] == True %}
          {% if login_provider.extra_token_name %}
              extra_token_name['{{login_provider.name}}'] = '{{login_provider.extra_token_name}}';
          {% endif %}
          {% if login_provider.type == 'password' %}
              create_pw_text['{{login_provider.name}}'] = '{{login_provider.create_password_prompt}}';
              change_pw_text['{{login_provider.name}}'] = '{{login_provider.change_password_prompt}}';
          {% endif %}
        {% endif %}
    {% endfor %}
    {% for login_provider in minor_login_providers %}
        {% if settings['SIGNIN_' + login_provider.name.upper() + '_ENABLED'] == True %}
          {% if login_provider.extra_token_name %}
              extra_token_name['{{login_provider.name}}'] = '{{login_provider.extra_token_name}}';
          {% endif %}
          {% if login_provider.type == 'password' %}
              create_pw_text['{{login_provider.name}}'] = '{{login_provider.create_password_prompt}}';
              change_pw_text['{{login_provider.name}}'] = '{{login_provider.change_password_prompt}}';
          {% endif %}
        {% endif %}
    {% endfor %}
    {% if user.is_authenticated() %}
        var userIsAuthenticated = true;
    {% else %}
        var userIsAuthenticated = false;
    {% endif %}
    askbot['settings']['signin_always_show_local_login'] = {% if settings.SIGNIN_ALWAYS_SHOW_LOCAL_LOGIN %}true{% else %}false{% endif %};
    $("body").authenticator();
</script>
