ajout de l'affichage du nombre d'IP libre dans la partie administration

de Brie
This commit is contained in:
Romain Beuque 2014-10-03 15:22:07 +02:00
parent c743de013b
commit 0e3ccfa51c
2 changed files with 7 additions and 0 deletions

View File

@ -99,6 +99,7 @@ class AdministrationController(AuthenticatedBaseController):
def index(self): def index(self):
groups = Groupes.get_all(self.user, self.user.residence_dn) 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()) 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 residence = None
if self.user is not None: if self.user is not None:
@ -108,6 +109,7 @@ class AdministrationController(AuthenticatedBaseController):
return { return {
"user" : self.user, "user" : self.user,
"residence" : residence, "residence" : residence,
"free_ip" : free_ips,
"groups_ldap" : groups, "groups_ldap" : groups,
"all_users" : all_users "all_users" : all_users
} }

View File

@ -2,12 +2,17 @@
<head> <head>
<link rel="stylesheet" type="text/css" href="/css/common.css" /> <link rel="stylesheet" type="text/css" href="/css/common.css" />
<link rel="stylesheet" type="text/css" href="/css/show.css" /> <link rel="stylesheet" type="text/css" href="/css/show.css" />
<link rel="stylesheet" type="text/css" href="/css/rooms.css" />
<xi:include href="common-css-header.html" /> <xi:include href="common-css-header.html" />
</head> </head>
<body> <body>
<xi:include href="navbar.html" /> <xi:include href="navbar.html" />
<a class="button" href="/" >RETOUR</a> <a class="button" href="/" >RETOUR</a>
<div class="section" > <div class="section" >
<div>
<div class="room_number vide_color">${"%03d" % free_ip}</div>
<span>IPs libres</span>
</div>
<span class="section_name show_section_name">GROUPES</span> <span class="section_name show_section_name">GROUPES</span>
<div py:for="group in groups_ldap"> <div py:for="group in groups_ldap">
<span class="item_name">${group.cn.first()}</span> <span class="item_name">${group.cn.first()}</span>