Une table des matières pour rendre l'affichage d'un stage plus consistant

This commit is contained in:
Evarin 2017-04-15 14:22:14 +02:00
parent c36141c7c5
commit 6c966ccb9c
4 changed files with 161 additions and 56 deletions

View file

@ -1,29 +1,42 @@
{% extends "avisstage/base.html" %}
{% load staticfiles %}
{% block extra_head %}
<script src="{% static 'js/toc.min.js' %}" type="text/javascript"></script>
<script type="text/javascript">
$(function(){$(".toc").toc({container:'.content'});});
</script>
{% endblock %}
{% block content %}
<h1>{{ object.sujet }}</h1>
{% if object.auteur == user.profil %}
<p><a href="{% url "avisstage:stage_edit" object.id %}">Modifier ce stage</a></p>
{% endif %}
<article class="stage">
<section class="misc">
<h3>À propos du stage</h3>
<p>{{ object.auteur.nom }} a fait ce stage du {{ object.date_debut }} au {{ object.date_fin }}, supervisé par {{ object.encadrants }}</p>
<ul class="infos">
{% for matiere in object.matieres.all %}
<li class="matiere">{{ matiere.nom }}</li>
{% endfor %}
{% for thematique in object.thematiques.all %}
<li class="thematique">{{ thematique.name }}</li>
{% endfor %}
</ul>
</section>
<div class="article-wrapper">
<div class="toc-wrapper">
<div class="toc">
</div>
</div>
<article class="stage">
<section class="misc">
<h3>À propos du stage</h3>
<p>{{ object.auteur.nom }} a fait ce stage du {{ object.date_debut }} au {{ object.date_fin }}, supervisé par {{ object.encadrants }}</p>
<ul class="infos">
{% for matiere in object.matieres.all %}
<li class="matiere">{{ matiere.nom }}</li>
{% endfor %}
{% for thematique in object.thematiques.all %}
<li class="thematique">{{ thematique.name }}</li>
{% endfor %}
</ul>
</section>
{% include "avisstage/detail/avis.html" with avis=object.avis_stage titre="Avis sur le stage" %}
{% include "avisstage/detail/avis.html" with avis=object.avis_stage titre="Avis sur le stage" %}
{% for avis in object.avislieu_set.all %}
{% include "avisstage/detail/avis.html" with avis=avis titre="Avis sur le lieu" %}
{% endfor %}
</article>
{% for avis in object.avislieu_set.all %}
{% include "avisstage/detail/avis.html" with avis=avis titre="Avis sur le lieu" %}
{% endfor %}
</article>
</div>
{% endblock %}