généralisation du header

This commit is contained in:
Roven Gabriel 2013-09-09 17:17:22 +02:00
parent 1a6d9d7df2
commit 28e4c456bf
15 changed files with 96 additions and 57 deletions

View File

@ -6,6 +6,7 @@ from tg.decorators import expose, validate
from brie.config import ldap_config from brie.config import ldap_config
from brie.lib.ldap_helper import * from brie.lib.ldap_helper import *
from brie.lib.aurore_helper import *
from brie.model.ldap import * from brie.model.ldap import *
from brie.controllers import auth from brie.controllers import auth
@ -70,7 +71,17 @@ class AdministrationController(AuthenticatedBaseController):
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())
return { "user" : self.user, "groups_ldap" : groups, "all_users" : all_users } residence = None
if self.user is not None:
residence = Residences.get_name_by_dn(self.user, self.user.residence_dn)
#end if
return {
"user" : self.user,
"residence" : residence,
"groups_ldap" : groups,
"all_users" : all_users
}
#end def #end def
#end class #end class

View File

@ -52,6 +52,7 @@ class MembersController(AuthenticatedBaseController):
return { return {
"user" : self.user,
"members" : members, "members" : members,
"residence" : residence_name, "residence" : residence_name,
"sort_name" : MembersController.sort_name "sort_name" : MembersController.sort_name

View File

@ -72,6 +72,7 @@ class RoomsController(AuthenticatedBaseController):
#end for area #end for area
return { return {
"user" : self.user,
"areas" : areas, "areas" : areas,
"color_picker" : self.color_picker, "color_picker" : self.color_picker,
"reverse_sorted_name" : self.reverse_sort_name, "reverse_sorted_name" : self.reverse_sort_name,

View File

@ -0,0 +1,25 @@
.form-signin {
max-width: 300px;
padding: 19px 29px 29px;
margin: 0 auto 20px;
background-color: #fff;
border: 1px solid #e5e5e5;
-webkit-border-radius: 5px;
-moz-border-radius: 5px;
border-radius: 5px;
-webkit-box-shadow: 0 1px 2px rgba(0,0,0,.05);
-moz-box-shadow: 0 1px 2px rgba(0,0,0,.05);
box-shadow: 0 1px 2px rgba(0,0,0,.05);
}
.form-signin .form-signin-heading,
.form-signin .checkbox {
margin-bottom: 10px;
}
.form-signin input[type="text"],
.form-signin input[type="password"] {
font-size: 16px;
height: auto;
margin-bottom: 15px;
padding: 7px 9px;
}

View File

@ -2,8 +2,10 @@
<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" />
<xi:include href="common-css-header.html" />
</head> </head>
<body> <body>
<xi:include href="navbar.html" />
<a class="button" href="/" >RETOUR</a> <a class="button" href="/" >RETOUR</a>
<div class="section" > <div class="section" >
<span class="section_name show_section_name">GROUPES</span> <span class="section_name show_section_name">GROUPES</span>

View File

@ -0,0 +1,14 @@
<html
xmlns:py="http://genshi.edgewall.org/"
xmlns:xi="http://www.w3.org/2001/XInclude"
py:strip=""
>
<link href="/css/bootstrap.css" rel="stylesheet"/>
<link href="/css/form-signin.css" rel="stylesheet"/>
<link href="/css/bootstrap-responsive.css" rel="stylesheet" />
<!-- HTML5 shim, for IE6-8 support of HTML5 elements -->
<!--[if lt IE 9]>
<script src="/js/html5shiv.js"></script>
<![endif]-->
</html>

View File

@ -5,8 +5,10 @@
<head> <head>
<link type="text/css" rel="Stylesheet" href="/css/common.css" /> <link type="text/css" rel="Stylesheet" href="/css/common.css" />
<link type="text/css" rel="Stylesheet" href="/css/show.css" /> <link type="text/css" rel="Stylesheet" href="/css/show.css" />
<xi:include href="common-css-header.html" />
</head> </head>
<body> <body>
<xi:include href="navbar.html" />
${edit_banner()} ${edit_banner()}
${back_show("member", member_ldap.uid.first())} ${back_show("member", member_ldap.uid.first())}
<div py:choose="member_ldap"> <div py:choose="member_ldap">

View File

@ -6,8 +6,10 @@
<link type="text/css" rel="Stylesheet" href="/css/common.css" /> <link type="text/css" rel="Stylesheet" href="/css/common.css" />
<link type="text/css" rel="Stylesheet" href="/css/show.css" /> <link type="text/css" rel="Stylesheet" href="/css/show.css" />
<link type="text/css" rel="Stylesheet" href="/css/edit.css" /> <link type="text/css" rel="Stylesheet" href="/css/edit.css" />
<xi:include href="common-css-header.html" />
</head> </head>
<body> <body>
<xi:include href="navbar.html" />
${edit_banner()} ${edit_banner()}
${back_show("room", room_ldap.uid.first())} ${back_show("room", room_ldap.uid.first())}
<div py:choose="room_ldap"> <div py:choose="room_ldap">

View File

@ -7,63 +7,11 @@
<meta name="author" content=""/> <meta name="author" content=""/>
<!-- Le styles --> <!-- Le styles -->
<link href="/css/bootstrap.css" rel="stylesheet"/> <xi:include href="common-css-header.html" />
<style type="text/css">
.form-signin {
max-width: 300px;
padding: 19px 29px 29px;
margin: 0 auto 20px;
background-color: #fff;
border: 1px solid #e5e5e5;
-webkit-border-radius: 5px;
-moz-border-radius: 5px;
border-radius: 5px;
-webkit-box-shadow: 0 1px 2px rgba(0,0,0,.05);
-moz-box-shadow: 0 1px 2px rgba(0,0,0,.05);
box-shadow: 0 1px 2px rgba(0,0,0,.05);
}
.form-signin .form-signin-heading,
.form-signin .checkbox {
margin-bottom: 10px;
}
.form-signin input[type="text"],
.form-signin input[type="password"] {
font-size: 16px;
height: auto;
margin-bottom: 15px;
padding: 7px 9px;
}
</style>
<link href="/css/bootstrap-responsive.css" rel="stylesheet" />
<!-- HTML5 shim, for IE6-8 support of HTML5 elements -->
<!--[if lt IE 9]>
<script src="/js/html5shiv.js"></script>
<![endif]-->
</head> </head>
<body> <body>
<xi:include href="login_widget.html" /> <xi:include href="navbar.html" />
<div>${login_widget(user)}</div>
<div py:if="user is not None"> <div py:if="user is not None">
<div class="navbar">
<div class="navbar-inner">
<a class="brand" href="#">Title</a>
<ul class="nav">
<li class="active"><a href="#">Home</a></li>
<li py:if="user.groups.admin"><a href="/rooms/index/${residence}">CHAMBRES</a></li>
<li py:if="user.groups.admin"><a href="/members/index/${residence}">MEMBRES</a></li>
<li py:if="user.groups.responsablereseau"><a href="/administration/">ADMINISTRATION</a></li>
</ul>
</div>
</div>
<div class="section">
<span class="section_name show_section_name"></span>
<a py:if="user.groups.admin" class="button" href="/rooms/index/${residence}/" >CHAMBRES</a>
<a py:if="user.groups.admin" class="button" href="/members/index/${residence}/" >MEMBRES</a>
<a py:if="user.groups.responsablereseau" class="button" href="/administration/" >ADMINISTRATION</a>
</div>
<div class="section" > <div class="section" >
<span class="section_name show_section_name">DEBUG</span> <span class="section_name show_section_name">DEBUG</span>
<div> <div>

View File

@ -5,7 +5,9 @@
<head> <head>
<link rel="stylesheet" type="text/css" href="/css/rooms.css" /> <link rel="stylesheet" type="text/css" href="/css/rooms.css" />
<link rel="stylesheet" type="text/css" href="/css/common.css" /> <link rel="stylesheet" type="text/css" href="/css/common.css" />
<xi:include href="common-css-header.html" />
</head> </head>
<body>
<!-- <!--
<div class="rooms_legend"> <div class="rooms_legend">
@ -30,6 +32,7 @@
</div> </div>
</div> </div>
--> -->
<xi:include href="navbar.html" />
<div class="area section"> <div class="area section">
<span class="section_name">PREVIEW</span> <span class="section_name">PREVIEW</span>
</div> </div>
@ -39,7 +42,7 @@
<input type="text" placeholder="prenom" name="prenom" /><br /> <input type="text" placeholder="prenom" name="prenom" /><br />
<input type="text" placeholder="nom" name="nom" /><br /> <input type="text" placeholder="nom" name="nom" /><br />
<input type="email" placeholder="email" name="mail" /><br /> <input type="email" placeholder="email" name="mail" /><br />
<input type="submit" value="GO!" /> <input type="submit" value="GO" />
</form> </form>
</div> </div>
<table> <table>
@ -54,4 +57,5 @@
<td><a href="/show/member/${residence}/${member.uid.first()}">${member.sn.first()}</a></td> <td><a href="/show/member/${residence}/${member.uid.first()}">${member.sn.first()}</a></td>
</tr> </tr>
</table> </table>
</body>
</html> </html>

View File

@ -0,0 +1,20 @@
<html
xmlns:py="http://genshi.edgewall.org/"
xmlns:xi="http://www.w3.org/2001/XInclude"
py:strip=""
>
<xi:include href="login_widget.html" />
<div>${login_widget(user)}</div>
<div py:if="user is not None">
<div class="navbar">
<div class="navbar-inner">
<a class="brand" href="/">Brie d'Aurore</a>
<ul class="nav">
<li py:if="user.groups.admin"><a href="/rooms/index/${residence}">CHAMBRES</a></li>
<li py:if="user.groups.admin"><a href="/members/index/${residence}">MEMBRES</a></li>
<li py:if="user.groups.responsablereseau"><a href="/administration/">ADMINISTRATION</a></li>
</ul>
</div>
</div>
</div>
</html>

View File

@ -5,8 +5,9 @@
<head> <head>
<link rel="stylesheet" type="text/css" href="/css/rooms.css" /> <link rel="stylesheet" type="text/css" href="/css/rooms.css" />
<link rel="stylesheet" type="text/css" href="/css/common.css" /> <link rel="stylesheet" type="text/css" href="/css/common.css" />
<xi:include href="common-css-header.html" />
</head> </head>
<body>
<!-- <!--
<div class="rooms_legend"> <div class="rooms_legend">
<py:def function="display_stat(name)"> <py:def function="display_stat(name)">
@ -30,6 +31,7 @@
</div> </div>
</div> </div>
--> -->
<xi:include href="navbar.html" />
<div class="area section"> <div class="area section">
<span class="section_name">PREVIEW</span> <span class="section_name">PREVIEW</span>
<div py:if="defined('preview')"> <div py:if="defined('preview')">
@ -55,4 +57,5 @@
</div> </div>
</div> </div>
</div> </div>
</body>
</html> </html>

View File

@ -4,8 +4,10 @@
<head> <head>
<link type="text/css" rel="Stylesheet" href="/css/common.css" /> <link type="text/css" rel="Stylesheet" href="/css/common.css" />
<link type="text/css" rel="Stylesheet" href="/css/rooms.css" /> <link type="text/css" rel="Stylesheet" href="/css/rooms.css" />
<xi:include href="common-css-header.html" />
</head> </head>
<body> <body>
<xi:include href="navbar.html" />
<table> <table>
<tr> <tr>
<th>prenom</th> <th>prenom</th>

View File

@ -5,8 +5,10 @@
<head> <head>
<link type="text/css" rel="Stylesheet" href="/css/common.css" /> <link type="text/css" rel="Stylesheet" href="/css/common.css" />
<link type="text/css" rel="Stylesheet" href="/css/show.css" /> <link type="text/css" rel="Stylesheet" href="/css/show.css" />
<xi:include href="common-css-header.html" />
</head> </head>
<body> <body>
<xi:include href="navbar.html" />
${back_rooms(room_ldap)} ${back_rooms(room_ldap)}
<div py:choose="member_ldap"> <div py:choose="member_ldap">
<span class="section_name" py:when="None">Entrée inexistante</span> <span class="section_name" py:when="None">Entrée inexistante</span>

View File

@ -5,8 +5,10 @@
<head> <head>
<link type="text/css" rel="Stylesheet" href="/css/common.css" /> <link type="text/css" rel="Stylesheet" href="/css/common.css" />
<link type="text/css" rel="Stylesheet" href="/css/show.css" /> <link type="text/css" rel="Stylesheet" href="/css/show.css" />
<xi:include href="common-css-header.html" />
</head> </head>
<body> <body>
<xi:include href="navbar.html" />
${back_rooms()} ${back_rooms()}
<a href="/edit/room/${room_ldap.uid.first()}" class="button">EDITER</a> <a href="/edit/room/${room_ldap.uid.first()}" class="button">EDITER</a>