aboutsummaryrefslogtreecommitdiff
path: root/templates
diff options
context:
space:
mode:
authorAlban Gruin2018-04-23 16:20:38 +0200
committerAlban Gruin2018-04-23 16:20:38 +0200
commit63ceb7ff232cd4015ae148bec31c6d72d9239c19 (patch)
tree9aee056480b5fae0c97f5e1c8be4ab1358602926 /templates
parentaf055dbf703af0eca03862194de1a0f34ac1fcc5 (diff)
parent9853d375d9e482c23f5fdbed9a3cf041029a92cb (diff)
Merge branch 'qsjps' into futur
Diffstat (limited to 'templates')
-rw-r--r--templates/calendars.html9
-rw-r--r--templates/group_list.html12
-rw-r--r--templates/group_weeks_list.html8
-rw-r--r--templates/groups_all_list.html6
-rw-r--r--templates/index.html21
-rw-r--r--templates/mention_list.html6
-rw-r--r--templates/qsjps.html17
-rw-r--r--templates/qsjps_form.html19
-rw-r--r--templates/room_weeks_list.html7
-rw-r--r--templates/timetable.html51
-rw-r--r--templates/timetable_common.html6
-rw-r--r--templates/year_list.html5
12 files changed, 140 insertions, 27 deletions
diff --git a/templates/calendars.html b/templates/calendars.html
index d97ea78..e6fcd9f 100644
--- a/templates/calendars.html
+++ b/templates/calendars.html
@@ -4,10 +4,15 @@
{% block body %}
<h2>ICS disponibles pour le groupe {{ group }}</h2>
+ <p>
+ Le format ICS (ou iCalendar) permet d’importer un calendrier
+ dans un agenda électronique.<br />
+ <a href="https://fr.wikipedia.org/wiki/ICalendar">En savoir plus</a>
+ </p>
<ul>
- <li><a href="{% url "ics" group.timetable.year.slug group.timetable.slug group.slug %}">Un seul ICS pour tous les cours</a></li>
+ <li><a href="{% url "ics" timetable.year.slug timetable.slug group.slug %}">Un seul ICS pour tous les cours</a></li>
{% for group in groups %}
- <li><a href="{% url "ics-group" group.timetable.year.slug group.timetable.slug group.slug %}">ICS des cours du groupe {{ group }} uniquement</a></li>
+ <li><a href="{% url "ics-group" timetable.year.slug timetable.slug group.slug %}">ICS des cours du groupe {{ group }} uniquement</a></li>
{% endfor %}
</ul>
{% endblock %}
diff --git a/templates/group_list.html b/templates/group_list.html
index f21b2b1..9c9a7fc 100644
--- a/templates/group_list.html
+++ b/templates/group_list.html
@@ -1,13 +1,19 @@
{% extends "index.html" %}
{% load dt_week %}
-{% block title %}{{ timetable }} &ndash; {% endblock %}
+{% block title %}{% if timetable %}{{ timetable }}{% else %}Emploi du temps des salles{% endif %} &ndash; {% endblock %}
{% block body %}
- <h3><a href="{{ timetable.url }}">{{ timetable }}</a></h3>
+ <h3>{% if timetable %}<a href="{{ timetable.source.url }}">{{ timetable }}</a>{% else %}Emploi du temps des salles{% endif %}</h3>
<ul>
{% for group in groups %}
- <li><a class="text"{% if group.weeks is not None %} href="{% url "timetable" timetable.year.slug timetable.slug group.slug %}"{% endif %}>{{ group }}</a> &mdash; {% for week in group.weeks %}<a href="{% url "timetable" timetable.year.slug timetable.slug group.slug week.year week|dt_week %}">{{ week|dt_prettyprint }}</a> {% if not forloop.last %}&ndash; {% endif %}{% empty %}<em>aucun cours dans le mois à venir</em>{% endfor %}</li>
+ <li><a class="text"{% if group.weeks is not None %} href="{% if timetable %}{% url "timetable" timetable.year.slug timetable.slug group.slug %}{% else %}{% url "room-timetable" group.slug %}{% endif %}"{% endif %}>{{ group }}</a> &mdash; {% for week in group.weeks %}<a href="{% if timetable %}{% url "timetable" timetable.year.slug timetable.slug group.slug week.year week|dt_week %}{% else %}{% url "room-timetable" group.slug week.year week|dt_week %}{% endif %}">{{ week|dt_prettyprint }}</a> {% if not forloop.last %}&ndash; {% endif %}{% empty %}<em>aucun cours dans le mois à venir</em>{% endfor %}</li>
{% endfor %}
</ul>
+ {% if timetable %}
+ <a href="{% url "mentions" timetable.year.slug %}">Retour à la liste des mentions</a> &ndash;
+ <a href="{% url "groups-all" timetable.year.slug timetable.slug %}">Tous les groupes</a>
+ {% else %}
+ <a href="{% url "index" %}">Retour à la liste des années</a>
+ {% endif %}
{% endblock %}
diff --git a/templates/group_weeks_list.html b/templates/group_weeks_list.html
new file mode 100644
index 0000000..c348d5d
--- /dev/null
+++ b/templates/group_weeks_list.html
@@ -0,0 +1,8 @@
+{% extends "index.html" %}
+{% load dt_week %}
+
+{% block title %}Semaines du groupe {{ group }} &ndash; {% endblock %}
+{% block pagetitle %}Semaines du groupe {{ group }}{% endblock %}
+{% block url %}{% url "timetable" timetable.year.slug timetable.slug group.slug element.year element|dt_week %}{% endblock %}
+{% block element %}{{ element|dt_prettyprint }} (semaine {{ element|dt_week }}){% endblock %}
+{% block navigation %}<a href="{% url "groups" timetable.year.slug timetable.slug %}">Liste des groupes</a>{% endblock %}
diff --git a/templates/groups_all_list.html b/templates/groups_all_list.html
new file mode 100644
index 0000000..36bc447
--- /dev/null
+++ b/templates/groups_all_list.html
@@ -0,0 +1,6 @@
+{% extends "index.html" %}
+
+{% block title %}Liste des groupes de {{ timetable }} &ndash; {% endblock %}
+{% block pagetitle %}Liste des groupes de {{ timetable }}{% endblock %}
+{% block url %}{% url "group-weeks" timetable.year.slug timetable.slug element.slug %}{% endblock %}
+{% block navigation %}<a href="{% url "groups" timetable.year.slug timetable.slug %}">Retour à la liste réduite</a>{% endblock %}
diff --git a/templates/index.html b/templates/index.html
index 71665bc..cdab591 100644
--- a/templates/index.html
+++ b/templates/index.html
@@ -4,7 +4,7 @@
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
{% block head %}{% endblock %}
- <title>{% block title %}{% if year %}{{ year }} &ndash; {% endif %}{% endblock %}celcatsanitizer</title>
+ <title>{% block title %}{% endblock %}celcatsanitizer</title>
<link rel="stylesheet" href="{% static "celcatsanitizer/style.css" %}">
</head>
<body>
@@ -13,18 +13,19 @@
</header>
<div class="content">
{% block body %}
- <h3>{% if year %}{{ year }} &ndash; Choisissez votre mention{% else %}Choisissez votre année{% endif %}</h3>
- <ul>
- {% for element in elements %}
- <li><a href="{% if year %}{% url "groups" year.slug element.slug %}{% else %}{% url "mentions" element.slug %}{% endif %}">{{ element }}</a></li>
- {% empty %}
- <p><em>Aucun emploi du temps à afficher</em></p>
- {% endfor %}
- </ul>
+ <h3>{% block pagetitle %}{% endblock %}</h3>
+ <ul>
+ {% for element in elements %}
+ <li><a href="{% block url %}{% endblock %}">{% block element %}{{ element }}{% endblock %}</a></li>
+ {% empty %}
+ <p><em>{% block empty %}Aucun emploi du temps à afficher{% endblock %}</em></p>
+ {% endfor %}
+ </ul>
+ {% block navigation %}{% endblock %}
{% endblock %}
</div>
<footer>
- <p>(c) 2017 &ndash; Alban Gruin &ndash; <a href="{% url "django.contrib.flatpages.views.flatpage" url="contact/" %}">contacter</a> &ndash; celcatsanitizer {{ celcatsanitizer_version }} &ndash; <a href="{% url "django.contrib.flatpages.views.flatpage" url="a-propos/" %}">à propos</a><br />
+ <p>(c) 2018 &ndash; Alban Gruin &ndash; <a href="{% url "django.contrib.flatpages.views.flatpage" url="contact/" %}">contacter</a> &ndash; celcatsanitizer {{ celcatsanitizer_version }} &ndash; <a href="{% url "django.contrib.flatpages.views.flatpage" url="a-propos/" %}">à propos</a><br />
Design inspiré par <a href="https://bestmotherfucking.website/">https://bestmotherfucking.website/</a></p>
</footer>
</body>
diff --git a/templates/mention_list.html b/templates/mention_list.html
new file mode 100644
index 0000000..3b9d8e8
--- /dev/null
+++ b/templates/mention_list.html
@@ -0,0 +1,6 @@
+{% extends "index.html" %}
+
+{% block title %}{{ year }} &ndash; {% endblock %}
+{% block pagetitle %}{{ year }} &ndash; Choississez votre mention{% endblock %}
+{% block url %}{% url "groups" year.slug element.slug %}{% endblock %}
+{% block navigation %}<a href="{% url "index" %}">Retour à la liste des années</a>{% endblock %}
diff --git a/templates/qsjps.html b/templates/qsjps.html
new file mode 100644
index 0000000..a166dbd
--- /dev/null
+++ b/templates/qsjps.html
@@ -0,0 +1,17 @@
+{% extends "index.html" %}
+{% load dt_week %}
+
+{% block title %}Trouver une salle &ndash; {% endblock %}
+
+{% block body %}
+ <h3>Trouver une salle entre {{ form.begin.value }} et {{ form.end.value }}</h3>
+ <ul>
+ {% with year=form.cleaned_data.day.year week=form.cleaned_data.day|dt_week %}
+ {% for room in rooms %}
+ <li><a href="{% url "room-timetable" room.slug year week %}">{{ room }}</li>
+ {% empty %}
+ <p>Aucune salle trouvée</p>
+ {% endfor %}
+ {% endwith %}
+ </ul>
+{% endblock %}
diff --git a/templates/qsjps_form.html b/templates/qsjps_form.html
new file mode 100644
index 0000000..280a7ad
--- /dev/null
+++ b/templates/qsjps_form.html
@@ -0,0 +1,19 @@
+{% extends "index.html" %}
+
+{% block title %}Trouver une salle &ndash; {% endblock %}
+
+{% block body %}
+ <h3>Trouver une salle</h3>
+ <form action="{% url "qsjps" %}" method="post">
+ <table>
+ {% for field in form.visible_fields %}
+ <tr>
+ <th>{{ field.label_tag }}</th>
+ <td>{{ field }}{% if field.errors %}<br /><small>{{ field.errors|join:" " }}</small>{% endif %}</td>
+ </tr>
+ {% endfor %}
+ <tr><th></th><td><input type="submit" value="Trouver une salle" /></td></tr>
+ </table>
+ </form>
+ <a href="{% url "rooms" %}">Retour à la liste des salles</a>
+{% endblock %}
diff --git a/templates/room_weeks_list.html b/templates/room_weeks_list.html
new file mode 100644
index 0000000..6a4c3d9
--- /dev/null
+++ b/templates/room_weeks_list.html
@@ -0,0 +1,7 @@
+{% extends "group_weeks_list.html" %}
+{% load dt_week %}
+
+{% block title %}Semaines de la salle {{ room }} &ndash; {% endblock %}
+{% block pagetitle %}Semaines de la salle {{ room }}{% endblock %}
+{% block url %}{% url "room-timetable" room.slug element.year element|dt_week %}{% endblock %}
+{% block navigation %}<a href="{% url "rooms" %}">Liste des salles</a>{% endblock %}
diff --git a/templates/timetable.html b/templates/timetable.html
index fc2065f..a6dc1ab 100644
--- a/templates/timetable.html
+++ b/templates/timetable.html
@@ -1,21 +1,54 @@
{% extends "index.html" %}
+{% load dt_week %}
-{% block head %}
+{% block head %}{% if group_mode %}
<meta name="description" content="Emploi du temps du groupe {{ group }} &ndash; Semaine {{ week }}" />
- <link rel="alternate" type="application/atom+xml" title="Emploi du temps du groupe {{ group }} (Atom)" href="{% url "atom" group.timetable.year.slug group.timetable.slug group.slug %}" />
- <link rel="alternate" type="application/rss+xml" title="Emploi du temps du groupe {{ group }} (RSS)" href="{% url "rss" group.timetable.year.slug group.timetable.slug group.slug %}" />
- <link rel="alternate" type="text/calendar" title="Emploi du temps du groupe {{ group }} (iCalendar)" href="{% url "ics" group.timetable.year.slug group.timetable.slug group.slug %}">
-{% endblock %}
+ <link rel="alternate" type="application/atom+xml" title="Emploi du temps du groupe {{ group }} (Atom)" href="{% url "atom" timetable.year.slug timetable.slug group.slug %}" />
+ <link rel="alternate" type="application/rss+xml" title="Emploi du temps du groupe {{ group }} (RSS)" href="{% url "rss" timetable.year.slug timetable.slug group.slug %}" />
+ <link rel="alternate" type="text/calendar" title="Emploi du temps du groupe {{ group }} (iCalendar)" href="{% url "ics" timetable.year.slug timetable.slug group.slug %}">
+{% endif %}{% endblock %}
-{% block title %}{{ group.timetable }} &ndash; {{ group }} &ndash; Semaine {{ week }} &ndash; {% endblock %}
+{% block title %}{% if group_mode %}{{ timetable }} &ndash;{% else %}Salle{% endif %} {{ group }} &ndash; Semaine {{ week }} &ndash; {% endblock %}
{% block body %}
- <h2>{{ group.timetable }} &ndash; {{ group }} &ndash; Semaine {{ week }}</h2>
+ <h2>{% if group_mode %}{{ timetable }} &ndash;{% else %}Salle{% endif %} {{ group }} &ndash; Semaine {{ week }}</h2>
<p>
{% if is_old_timetable %}
- <b><a href="{% url "timetable" group.timetable.year.slug group.timetable.slug group.slug %}">Accéder à l’emploi du temps de cette semaine.</b></a><br />
+ <b><a href="{% if group_mode %}{% url "timetable" timetable.year.slug timetable.slug group.slug %}{% else %}{% url "room-timetable" group.slug %}{% endif %}">
+ Accéder à l’emploi du temps de cette semaine.
+ </b></a><br />
{% endif %}
{% if last_update %}Dernière mise à jour le {{ last_update|date:"l j F o" }} à {{ last_update|date:"H:i" }}{% endif %}
</p>
{% include "timetable_common.html" %}
- <p class="subscribe"><a href="{% url "calendars" group.timetable.year.slug group.timetable.slug group.slug %}">ICS</a> &ndash; <a href="{% url "rss" group.timetable.year.slug group.timetable.slug group.slug %}">RSS</a> &ndash; <a href="{% url "atom" group.timetable.year.slug group.timetable.slug group.slug %}">Atom</a></p>{% endblock %}
+ <p class="subscribe">
+ {% if group_mode %}
+ <a href="{% url "groups" timetable.year.slug timetable.slug %}">Retour à la liste des groupes</a>
+ {% else %}
+ <a href="{% url "rooms" %}">Retour à la liste des salles</a>
+ {% endif %} &ndash;
+ {% if last_week is not None %}
+ <a href="{% if group_mode %}{% url "timetable" timetable.year.slug timetable.slug group.slug last_week.year last_week|dt_week %}{% else %}{% url "room-timetable" group.slug last_week.year last_week|dt_week %}{% endif %}">
+ Semaine {{ last_week|dt_week }}
+ </a>
+ &ndash;
+ {% endif %}
+ {% if next_week is not None %}
+ <a href="{% if group_mode %}{% url "timetable" timetable.year.slug timetable.slug group.slug next_week.year next_week|dt_week %}{% else %}{% url "room-timetable" group.slug next_week.year next_week|dt_week %}{% endif %}">
+ Semaine {{ next_week|dt_week }}
+ </a>
+ &ndash;
+ {% endif %}
+ {% if group_mode %}
+ <a href="{% url "group-weeks" timetable.year.slug timetable.slug group.slug %}">Liste des semaines</a>
+ {% else %}
+ <a href="{% url "room-weeks" group.slug %}">Liste des semaines</a>
+ {% endif %}
+ <br />
+ {% if group_mode %}
+ <a href="{% url "calendars" timetable.year.slug timetable.slug group.slug %}">ICS</a> &ndash;
+ <a href="{% url "rss" timetable.year.slug timetable.slug group.slug %}">RSS</a> &ndash;
+ <a href="{% url "atom" timetable.year.slug timetable.slug group.slug %}">Atom</a>
+ {% endif %}
+ </p>
+{% endblock %}
diff --git a/templates/timetable_common.html b/templates/timetable_common.html
index 62b1d71..6e59322 100644
--- a/templates/timetable_common.html
+++ b/templates/timetable_common.html
@@ -4,9 +4,9 @@
<h3>{% filter title %}{{ day.0.begin|date:"l j F o" }}{% endfilter %} &ndash; de {{ day.0.begin|date:"H:i" }} à {% with day|last as last %}{{ last.end|date:"H:i" }}{% endwith %}</h3>
<ul>{% for course in day %}
<li class="course">
- <b>{{ course }}</b>{% if course.type %} ({{ course.type }}){% endif %}, de {{ course.begin|date:"H:i" }} à {{ course.end|date:"H:i" }}{% if course.rooms.all|length > 0 %}<br />
- <em>{{ course.rooms.all|format_rooms }}</em>{% endif %}{% if course.notes %}<br />
- <small>Remarques : {{ course.notes }}</small>{% endif %}
+ <b>{{ course }}</b>{% if course.type %} ({{ course.type }}){% endif %}, de {{ course.begin|date:"H:i" }} à {{ course.end|date:"H:i" }}{% if group_mode and course.rooms.all|length > 0 or not group_mode and course.groups.all|length > 0 %}<br />
+ <em>{% if group_mode %}{{ course.rooms.all|format_rooms }}{% else %}{{ course.groups.all|join:", " }}{% endif %}</em>{% endif %}{% if course.notes %}<br />
+ <small>Remarques : {{ course.notes|linebreaksbr }}</small>{% endif %}
</li>{% endfor %}
</ul>
</section>{% empty %}
diff --git a/templates/year_list.html b/templates/year_list.html
new file mode 100644
index 0000000..4256ec1
--- /dev/null
+++ b/templates/year_list.html
@@ -0,0 +1,5 @@
+{% extends "index.html" %}
+
+{% block pagetitle %}Choisissez votre année{% endblock %}
+{% block url %}{% url "mentions" element.slug %}{% endblock %}
+{% block navigation %}<a href="{% url "rooms" %}">Emploi du temps des salles</a>{% endblock %}