Skip to content
Snippets Groups Projects
Commit c4ed7708 authored by Dorian Lesbre's avatar Dorian Lesbre
Browse files

Affichage du status distanciel/présentiel

parent c75b5a51
No related branches found
No related tags found
No related merge requests found
......@@ -84,7 +84,14 @@ class InterludesActivity(models.Model):
@property
def pretty_type(self) -> str:
return self.Types(self.act_type).label
type = self.Types(self.act_type).label
status = self.Status(self.status)
status_repr = "présentiel ou distanciel"
if status == self.Status.DISTANT:
status_repr = "distanciel"
elif status == self.Status.PRESENT:
status_repr = "présentiel"
return "{} ({})".format(type, status_repr)
def conflicts(self, other: "InterludesActivity") -> bool:
"""Check whether these activites overlap"""
......
......@@ -112,6 +112,18 @@
<div class="qty">Obtenus</div>
<div class="nb_small">{{ metrics.granted }}</div>
</div>
<div class="stat">
<div class="qty">Présentiel</div>
<div class="nb_small">{{ metrics.st_present }}</div>
</div>
<div class="stat">
<div class="qty">Distanciel</div>
<div class="nb_small">{{ metrics.st_distant }}</div>
</div>
<div class="stat">
<div class="qty">Les deux</div>
<div class="nb_small">{{ metrics.st_both }}</div>
</div>
</div>
<h2>Répartition des activités</h2>
......
......@@ -167,6 +167,10 @@ class AdminView(SuperuserRequiredMixin, TemplateView):
wish = wishes.count()
granted = wishes.filter(accepted=True).count()
st_present = acts.filter(status=InterludesActivity.Status.PRESENT).count()
st_distant = acts.filter(status=InterludesActivity.Status.DISTANT).count()
st_both = acts.filter(status=InterludesActivity.Status.BOTH).count()
# validation de la repartition des activités
accepted = wishes.filter(accepted=True)
# order_by is useless but required
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment