Add class listings with training summary

This commit is contained in:
Claude Paroz 2016-01-19 18:01:18 +01:00
parent 6c9ab66ae7
commit 538db63679
6 changed files with 78 additions and 2 deletions

27
templates/class.html Normal file
View file

@ -0,0 +1,27 @@
{% extends "admin/base_site.html" %}
{% load i18n %}
{% block breadcrumbs %}
<div class="breadcrumbs">
<a href="{% url 'admin:index' %}">{% trans 'Home' %}</a>
&rsaquo; <a href="{% url 'classes' %}">Liste des classes</a>
</div>
{% endblock %}
{% block content %}
<h2>{{ klass.name }}</h2>
<h3>Récapitulatif des stages</h3>
<table>
{% for student in students %}
<tr class="{% cycle 'row1' 'row2' %}">
<td><a href="{% url 'admin:stages_student_change' student.pk %}">{{ student }}</a></td>
<td>{{ student.birth_date }}</td>
{% for train in student.training_set.all %}
<td>{{ train.availability.period }}<br>{{ train.availability.corporation }}<br>
{% if train.comment %}<div style="float: right;"><img src="{{ STATIC_URL}}admin/img/icon-unknown.svg" title="{{ train.comment }}"></div>{% endif %}
<i>{{ train.availability.domain }}</i></td>
{% endfor %}
</tr>
{% endfor %}
</table>
{% endblock %}