Rework report import view and add individual student report send form

This commit is contained in:
Claude Paroz 2018-02-05 16:25:32 +01:00
parent 7488cbcd31
commit b966e140b8
12 changed files with 167 additions and 74 deletions

View file

@ -76,7 +76,6 @@
<li><a href="{% url 'import-students' %}">Importer un fichier d'étudiants</a></li>
<li><a href="{% url 'import-hp' %}">Importer le fichier HP</a></li>
<li><a href="{% url 'import-hp-contacts' %}">Importer les formateurs (fichier HP)</a></li>
<li><a href="{% url 'import-bulletins' %}">Envoyer les bulletins (par classe)</a></li>
<li style="margin-top: 1em;"><a href="{% url 'stages_export' %}">Exporter les données de stages</a> (récentes)</li>
<li><a href="{% url 'stages_export' 'all' %}">Exporter les données de stages</a> (toutes)</li>
<li><a href="{% url 'imputations_export' %}">Exporter les données comptables</a></li>

View file

@ -10,15 +10,30 @@
{% block content %}
<h2>{{ klass.name }}</h2>
<ul>
<li><a href="{% url 'import-reports' klass.pk %}">Importer des bulletins semestriels</a></li>
</ul>
<div style="float:right;">
<a href="{% url 'class' object.pk %}?format=xls"><img src="{% static 'img/xls.png' %}" title="Exportation Excel" width="24"></a>
</div>
<h3>Récapitulatif des stages</h3>
<h3>Liste des éléves</h3>
<table>
<thead><th>Nom, prénom</th><th>Date naiss.</th><th>Bulletins</th><th>Récapitulatif des stages</th></thead>
{% 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>
<td>{% if student.report_sem1 %}<a href="{{ student.report_sem1.url }}">Sem. 1</a>
{% if student.report_sem1_sent %}<img src="{% static 'admin/img/icon-yes.svg' %}" title="Envoyé le {{ student.report_sem1_sent }}">{% else %}
<a href="{% url 'send-student-reports' student.pk 1 %}"><img src="{% static 'img/envelope.png' %}" width="18" title="Envoyer le bulletin à l'élève"></a>
{% endif %}
{% endif %}
{% if student.report_sem2 %}<br><a href="{{ student.report_sem2.url }}">Sem. 2</a>
{% if student.report_sem2_sent %}<img src="{% static 'admin/img/icon-yes.svg' %}" title="Envoyé le {{ student.report_sem2_sent }}">{% else %}
<a href="{% url 'send-student-reports' student.pk 2 %}"><img src="{% static 'img/envelope.png' %}" width="18" title="Envoyer le bulletin à l'élève"></a>
{% endif %}
{% endif %}
</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 'admin/img/icon-unknown.svg' %}" title="{{ train.comment }}"></div>{% endif %}

View file

@ -1,11 +1,10 @@
Madame, Monsieur,
Vous trouverez en annexe le bulletin scolaire de {{ student_name }} pour le semestre écoulé.
Vous trouverez en annexe le bulletin scolaire de {{student.civility }} {{ student.full_name }} pour le semestre écoulé.
Nous vous souhaitons bonne réception de ce document et vous prions de recevoir, Madame, Monsieur, nos salutations les plus cordiales.
Secrétariat de l'EPC
{{ sender.first_name }} {{ sender.last_name }}
{{ sender.email }}
tél. 032 886 33 00
{{ sender_name }}
{{ sender_email }}

View file

@ -16,5 +16,6 @@
<tr><td><input type="submit" value="Envoyer"></td></tr>
</table>
{% block post_form %}{% endblock %}
</form>
{% endblock %}

View file

@ -0,0 +1,5 @@
{% extends "email_base.html" %}
{% block post_form %}
Bulletin qui sera joint au message: <a href="{{ pdf_field.url }}">{{ pdf_field.name }}</a>
{% endblock %}

View file

@ -8,6 +8,8 @@
{% endblock %}
{% block content %}
<h2>{{ view.title }}</h2>
<form action="." method="post" enctype="multipart/form-data">{% csrf_token %}
{{ form.as_p }}
<input type="submit" value="Envoyer">