feat(templates): Rename base directory

This commit is contained in:
Tom Hubrecht 2024-07-02 14:53:54 +02:00
parent 484962f666
commit 8d7768ab69
11 changed files with 93 additions and 118 deletions

View file

@ -1,5 +1,4 @@
{% load static %} {% load i18n static %}
{% load i18n %}
{% get_current_language as current_language %} {% get_current_language as current_language %}
<!DOCTYPE html> <!DOCTYPE html>
<html {% if current_language %}lang="{{ current_language }}"{% endif %}> <html {% if current_language %}lang="{{ current_language }}"{% endif %}>
@ -20,8 +19,8 @@
<header> <header>
<img class="logo" width="73" height="100" src="{% static "img/logo.svg" %}" alt="{% trans "ENS logo" %}" /> <img class="logo" width="73" height="100" src="{% static "img/logo.svg" %}" alt="{% trans "ENS logo" %}" />
<div id="headtext"> <div id="headtext">
<div>{% blocktrans %}Central Authentication Service{% endblocktrans %}</div> <div>{% trans "Central Authentication Service" %}</div>
<div>{% blocktrans %}ENS Students{% endblocktrans %}</div> <div>{% trans "ENS Students" %}</div>
</div> </div>
</header> </header>
<main> <main>

View file

@ -0,0 +1,28 @@
{% 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,35 @@
{% extends "cas_eleves/base.html" %}
{% load i18n %}
{% block content %}
<div class="login_msg">
<h2>{% trans "Logged in successfully" %}</h2>
<p>{% trans "You have successfully logged into the Central Authentication Service." %}</p>
<p>
{% trans "When you are done using ENS students' services, you can log out to prevent anyone unauthorized from accessing your sessions on this computer." %}
</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,12 @@
{% extends "cas_eleves/base.html" %}
{% load i18n %}
{% block content %}
<h2>{% trans "Please log in with your Clipper credentials" %}</h2>
<form method="post"
id="login_form"
{% if post_url %}action="{{ post_url }}"{% endif %}>
{% csrf_token %}
{% include "cas_eleves/form.html" %}
<button type="submit">{% trans "Log in" %}</button>
</form>
{% endblock %}

View file

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

View file

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

View file

@ -1,33 +0,0 @@
{% 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

@ -1,43 +0,0 @@
{% 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

@ -1,16 +0,0 @@
{% 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

@ -1,11 +0,0 @@
{% 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

@ -1,11 +0,0 @@
{% 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 %}