From 0e3ccfa51cb318e0b0610e1399dc7be2884e46bd Mon Sep 17 00:00:00 2001 From: Romain Beuque Date: Fri, 3 Oct 2014 15:22:07 +0200 Subject: [PATCH] ajout de l'affichage du nombre d'IP libre dans la partie administration de Brie --- Brie/brie/controllers/administration.py | 2 ++ Brie/brie/templates/administration/index.html | 5 +++++ 2 files changed, 7 insertions(+) diff --git a/Brie/brie/controllers/administration.py b/Brie/brie/controllers/administration.py index 33d267e..31ff0e8 100644 --- a/Brie/brie/controllers/administration.py +++ b/Brie/brie/controllers/administration.py @@ -99,6 +99,7 @@ class AdministrationController(AuthenticatedBaseController): def index(self): groups = Groupes.get_all(self.user, self.user.residence_dn) all_users = sorted(Member.get_all(self.user, self.user.residence_dn), key=lambda u: u.cn.first()) + free_ips = len(IpReservation.get_all_free(self.user, self.user.residence_dn)) residence = None if self.user is not None: @@ -108,6 +109,7 @@ class AdministrationController(AuthenticatedBaseController): return { "user" : self.user, "residence" : residence, + "free_ip" : free_ips, "groups_ldap" : groups, "all_users" : all_users } diff --git a/Brie/brie/templates/administration/index.html b/Brie/brie/templates/administration/index.html index e77a25c..889cb4a 100644 --- a/Brie/brie/templates/administration/index.html +++ b/Brie/brie/templates/administration/index.html @@ -2,12 +2,17 @@ + RETOUR
+
+
${"%03d" % free_ip}
+ IPs libres +
GROUPES
${group.cn.first()}