Override cas_server templates

This commit is contained in:
Théophile Bastian 2020-03-24 15:38:16 +01:00
parent df10bb54b7
commit cc8be8a775
10 changed files with 173 additions and 0 deletions

View file

@ -0,0 +1,4 @@
{% load static %}
{% load i18n %}
<img class="logo" src="{% static "img/logo.svg" %}" alt="{% trans "ENS logo" %}" />

View file

@ -0,0 +1,8 @@
{% load static %}
{% load i18n %}
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>{% trans "ENS student authentication" %}</title>
<link type="text/css" rel="stylesheet" href="{% static "css/style.css" %}" />
<link rel="shortcut icon" type="image/x-icon" href="/static/cas_server/favicon.ico"/>

View file

@ -0,0 +1,11 @@
{% load static %}
{% load i18n %}
<header>
{% include "_partials/ens_logo.html" %}
<div id="headtext">
<div>
{% blocktrans %}Central Authentication Service{% endblocktrans %}
</div>
<div>{% blocktrans %}ENS Students{% endblocktrans %}</div>
</div>
</header>

View file

@ -0,0 +1,9 @@
{% if messages %}
<ul class="messages">
{% for message in messages %}
<li {% if message.tags %} class="{{ message.tags }}"{% endif %}>
{{ message }}
</li>
{% endfor %}
</ul>
{% endif %}

View file

@ -0,0 +1,27 @@
{% load static %}
{% load i18n %}
{% get_current_language as current_language %}
<!DOCTYPE html>
<html {% if current_language %}lang="{{ current_language }}"{% endif %}>
<head>
{% include "_partials/head.html" %}
{% block "extra_head" %}{% endblock %}
</head>
<body>
{% include "_partials/header.html" %}
<main>
{% include "_partials/messages.html" %}
{% block content %}
{% endblock %}
</main>
<div id="ens_logo_foot">
{% include "_partials/ens_logo.html" %}
</div>
{% block "extra_foot" %}{% endblock %}
</body>
</html>

View file

@ -0,0 +1,33 @@
{% load cas_server %}
{% if form.non_field_errors %}
<ul class="errorlist">
{% for error in form.non_field_errors %}
<li>
{{error}}
</li>
{% endfor %}
</ul>
{% endif %}
{% for field in form %}{% if not field|is_hidden %}
<div id="formfield_{{ field.auto_id }}" class="formfield
{% if not form.non_field_errors %}
{% if field.errors %} error_field {% endif %}
{% endif %}"
>{% spaceless %}
{% if field.errors %}
<ul class="errorlist">
{% for error in field.errors %}
<li>{{error}}</li>
{% endfor %}
</ul>
{% endif %}
<div class="labelled_input {% if field|is_checkbox %}checkbox_input{% endif %}">
<div class="label_line">
<label class="control-label" for="{{field.auto_id}}">{{field.label}}</label>
</div>
{{field}}
</div>
{% endspaceless %}</div>
{% else %}{{field}}{% endif %}{% endfor %}

View file

@ -0,0 +1,43 @@
{% extends "cas_server/base.html" %}
{% load i18n %}
{% block content %}
<div class="login_msg">
<h2>{% trans "Logged in successfully" %}</h2>
<p>{% blocktrans %}
You have successfully logged into the Central Authentication Service.
{% endblocktrans %}</p>
<p>{% blocktrans %}
When you are done using ENS students' services, you can log out to prevent
anyone unauthorized from accessing your sessions on this computer.
{% endblocktrans %}</p>
</div>
<form method="get" action="logout">
<div class="formfield">
<div class="labelled_input checkbox_input">
<div class="label_line">
<label for="id_all">
{% trans "Log me out from all my sessions" %}
</label>
</div>
<input type="checkbox" id="id_all" name="all" value="1" />
</div>
</div>
{% if settings.CAS_FEDERATE and request.COOKIES.remember_provider %}
<div class="formfield">
<div class="labelled_input checkbox_input">
<div class="label_line">
<label for="id_forget_provider">
{% trans "Forget the identity provider" %}
</label>
</div>
<input type="checkbox" id="id_forget_provider" name="forget_provider" value="1" />
</div>
</div>
{% endif %}
<button type="submit">{% trans "Logout" %}</button>
</form>
{% endblock %}

View file

@ -0,0 +1,16 @@
{% extends "cas_server/base.html" %}
{% load i18n %}
{% block content %}
<h2>{% blocktrans %}
Please log in with your Clipper credentials
{% endblocktrans %}</h2>
<form method="post" id="login_form"{% if post_url %} action="{{post_url}}"{% endif %}>
{% csrf_token %}
{% include "cas_server/form.html" %}
<button type="submit">{% trans "Log in" %}</button>
</form>
{% endblock %}

View file

@ -0,0 +1,11 @@
{% extends "cas_server/base.html" %}
{% load static %}
{% load i18n %}
{% block content %}
<h2>{% trans "Clipper logout" %}</h2>
<p>{% blocktrans %}
You have been successfully logged out from your Clipper account.
{% endblocktrans %}</p>
{% endblock %}

View file

@ -0,0 +1,11 @@
{% extends "cas_server/base.html" %}
{% load static %}
{% load i18n %}
{% block content %}
<form class="form-signin" method="post">
{% csrf_token %}
{% include "cas_server/form.html" %}
<button type="submit">{% trans "Connect to the service" %}</button>
</form>
{% endblock %}