base.html 4.9 KB
Newer Older
1 2
{% load i18n %}{% load staticfiles %}{% get_current_language as LANGUAGE_CODE %}<!DOCTYPE html>
<html{% if LANGUAGE_CODE %} lang="{{LANGUAGE_CODE}}"{% endif %}>
3 4 5 6 7 8 9 10 11 12 13 14
    <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]-->
15
        {% if settings.CAS_FAVICON_URL %}<link rel="shortcut icon" href="{{settings.CAS_FAVICON_URL}}" />{% endif %}
16
        <link href="{% static "cas_server/styles.css" %}" rel="stylesheet">
17 18
    </head>
    <body>
19
      <div id="wrap">
20 21 22 23 24
        <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">
25
                    {% if settings.CAS_LOGO_URL %}<img src="{{settings.CAS_LOGO_URL}}" alt="cas-logo" />{% endif %}
26 27 28 29 30 31 32 33
                    {% 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 %}
34 35 36 37 38 39
            {% for msg in CAS_INFO_RENDER %}
              <div class="alert alert-{{msg.type}}{% if msg.discardable %} alert-dismissable{% endif %}">
                {% if msg.discardable %}<button type="button" class="close" data-dismiss="alert" aria-hidden="true" id="info-{{msg.name}}">&#215;</button>{% endif %}
                <p>{{msg.message}}</p>
              </div>
            {% endfor %}
40 41 42
            {% 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>
43
                <p>{% blocktrans %}A new version of the application is available. This instance runs {{VERSION}} and the last version is {{LAST_VERSION}}. Please consider upgrading.{% endblocktrans %}</p>
44 45 46
              </div>
            {% endif %}
            {% block ante_messages %}{% endblock %}
47 48 49
            {% for message in messages %}
                <div {% spaceless %}
                    {% if message.level == message_levels.DEBUG %}
50
                        class="alert alert-warning"
51
                    {% elif message.level == message_levels.INFO %}
52
                        class="alert alert-info"
53
                    {% elif message.level == message_levels.SUCCESS %}
54
                        class="alert alert-success"
55
                    {% elif message.level == message_levels.WARNING %}
56
                        class="alert alert-warning"
57
                    {% else %}
58
                        class="alert alert-danger"
59 60
                    {% endif %}
                {% endspaceless %}>
Valentin Samir's avatar
Valentin Samir committed
61
                    <p>{{message}}</p>
62 63 64 65 66 67 68 69
                </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 -->
70 71 72 73
      </div>
      <div style="clear: both;"></div>
      {% if settings.CAS_SHOW_POWERED %}
      <div id="footer">
74
          <p><a class="text-muted" href="https://pypi.org/project/django-cas-server/">django-cas-server powered</a></p>
75 76 77 78 79
      </div>
      {% endif %}
      <script src="{{settings.CAS_COMPONENT_URLS.jquery}}"></script>
      <script src="{{settings.CAS_COMPONENT_URLS.bootstrap3_js}}"></script>
      <script src="{% static "cas_server/functions.js" %}"></script>
80 81 82 83 84 85 86 87 88 89 90
      <script type="text/javascript">
{% if settings.CAS_NEW_VERSION_HTML_WARNING and upgrade_available %}
discard_and_remember("#alert-version", "cas-alert-version", "{{LAST_VERSION}}");
{% endif %}
{% for msg in CAS_INFO_RENDER %}
{% if msg.discardable %}
discard_and_remember("#info-{{msg.name}}", "cas-info-{{msg.name}}", "{{msg.hash}}");
{% endif %}
{% endfor %}
{% block javascript_inline %}{% endblock %}
</script>
91
      {% block javascript %}{% endblock %}
92 93
    </body>
</html>
94 95 96
<!--
Powered by django-cas-server version {{VERSION}}

97
Pypi: https://pypi.org/project/django-cas-server/
98 99
github: https://github.com/nitmir/django-cas-server
-->