{% load i18n %}
{% load staticfiles %}
<!DOCTYPE html>
<html{% if request.LANGUAGE_CODE %} lang="{{ request.LANGUAGE_CODE }}"{% endif %}>
    <head>
        <meta charset="utf-8">
        <!--[if IE]><meta http-equiv="X-UA-Compatible" content="IE=edge" /><![endif]-->
        <meta name="viewport" content="width=device-width, initial-scale=1">
        <title>{% block title %}{% trans "Central Authentication Service"  %}{% endblock %}</title>
        <link href="{{settings.CAS_COMPONENT_URLS.bootstrap3_css}}" rel="stylesheet">
        <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
        <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
        <!--[if lt IE 9]>
        <script src="{{settings.CAS_COMPONENT_URLS.html5shiv}}"></script>
        <script src="{{settings.CAS_COMPONENT_URLS.respond}}"></script>
        <![endif]-->
        {% if settings.CAS_FAVICON_URL %}<link rel="shortcut icon" href="{{settings.CAS_FAVICON_URL}}" />{% endif %}
        <link href="{% static "cas_server/styles.css" %}" rel="stylesheet">
    </head>
    <body>
        <div class="container">
            {% if auto_submit %}<noscript>{% endif %}
            <div class="row">
              <div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
                <h1 id="app-name">
                    {% if settings.CAS_LOGO_URL %}<img src="{{settings.CAS_LOGO_URL}}"></img> {% endif %}
                    {% trans "Central Authentication Service" %}</h1>
              </div>
            </div>
            {% if auto_submit %}</noscript>{% endif %}
            <div class="row">
            <div class="col-lg-3 col-md-3 col-sm-2 col-xs-12"></div>
            <div class="col-lg-6 col-md-6 col-sm-8 col-xs-12">
            {% if auto_submit %}<noscript>{% endif %}
            {% if settings.CAS_NEW_VERSION_HTML_WARNING and upgrade_available %}
              <div class="alert alert-info alert-dismissable">
                <button type="button" class="close" data-dismiss="alert" aria-hidden="true" id="alert-version">&#215;</button>
                {% blocktrans %}A new version of the application is available. This instance runs {{VERSION}} and the last version is {{LAST_VERSION}}. Please consider upgrading.{% endblocktrans %}
              </div>
            {% endif %}
            {% block ante_messages %}{% endblock %}
            {% for message in messages %}
                <div {% spaceless %}
                    {% if message.level == message_levels.DEBUG %}
                        class="alert alert-warning"
                    {% elif message.level == message_levels.INFO %}
                        class="alert alert-info"
                    {% elif message.level == message_levels.SUCCESS %}
                        class="alert alert-success"
                    {% elif message.level == message_levels.WARNING %}
                        class="alert alert-warning"
                    {% else %}
                        class="alert alert-danger"
                    {% endif %}
                {% endspaceless %}>
                    {{ message }}
                </div>
            {% endfor %}
            {% if auto_submit %}</noscript>{% endif %}
            {% block content %}{% endblock %}
            </div>
            <div class="col-lg-3 col-md-3 col-sm-2 col-xs-0"></div>
            </div>
        </div> <!-- /container -->
        <script src="{{settings.CAS_COMPONENT_URLS.jquery}}"></script>
        <script src="{{settings.CAS_COMPONENT_URLS.bootstrap3_js}}"></script>
        {% if settings.CAS_NEW_VERSION_HTML_WARNING and upgrade_available %}
        <script src="{% static "cas_server/alert-version.js" %}"></script>
        <script>alert_version("{{LAST_VERSION}}")</script>
        {% endif %}
    </body>
</html>
