modification du template code lutin. L'arbre pas beau a ete remplace par un

menu statique généré
This commit is contained in:
bpoussin 2003-12-22 19:15:45 +00:00
parent a6962d4a5a
commit 2bb7016f33
36 changed files with 301 additions and 220 deletions

View File

@ -1,30 +1,15 @@
# -*- coding: iso-8859-15 -*-
## level is tuple composed by the level number and dictionnary that remember
## for all level if the last element of this level is reached
def upLevel(level):
return (level[0]+1, level[1])
def isLast(level, b):
if level[1].has_key(b):
return level[1][b]
def getClass(object):
if object.getThingName() == 'rubrics.Rubric':
return 'menu-close'
else:
return 0
def updateLevel(level, bool):
"""
put the bool value in dictionnary for the given level.
"""
level[1][level[0]] = bool
return level
return 'menu-leaf'
def haveChild(currentObject, sub, objectPath):
try:
result = currentObject and sub and sub.getThingName() == 'Rubric' and (
result = currentObject and sub and sub.getThingName() == 'rubrics.Rubric' and (
currentObject.id == sub.id or (
objectPath and sub.id in [o.id for o in objectPath \
if hasattr(o, 'id')]))
except:
result = 0
return result

View File

@ -1,5 +1,4 @@
<metal:block define-macro="pre"><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<metal:block define-macro="pre"><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
</metal:block>
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:tal="http://xml.zope.org/namespaces/tal"
@ -15,158 +14,80 @@ http://www.codelutin.com
<title>Code Lutin</title>
<!-- Created by: POUSSIN Benjamin, 30-Jul-2002 -->
<!-- Changed by: POUSSIN Benjamin, 17-Jan-2003 -->
<!-- Changed by: Benjamin Poussin, 10-Jun-2003 -->
<script metal:use-macro="forms.tal/formScript"></script>
<link rel="stylesheet" href="/css/default.css" tal:reroot="href" />
<link rel="stylesheet" href="/css/banquise.css" tal:reroot="href" />
<link rel="stylesheet" href="/css/codelutin.org.css" tal:reroot="href" />
<link rel="home" href="/" tal:reroot="href" />
<meta metal:define-slot="contextualHeaders" />
<script src="/javascript/tooltips.js" tal:reroot="src" type="text/javascript"></script>
<script metal:use-macro="forms.tal/formScript"></script>
</head>
<body>
<body tal:define="treemenu loadExtension('treemenu')">
<!-- Banquise -->
<div metal:use-macro="banquise.tal/banquise" />
<div id="zonetitle">
<table cellspacing="0" cellpadding="0" border="0">
<tbody>
<tr>
<td>
<a href="http://www.codelutin.com/">
<img tal:reroot="src" src="/images/lutin-title.png" alt="CodeLutin.org"
width=443 height=95 hspace=4 vspace=6 align="bottom" border=0>
</a>
</td>
</tr>
</tbody>
</table>
</div>
<table width="100%" cellspacing="0" cellpadding="0" border="0
">
<tbody>
<tr><td rowspan="2" valign="top">
<table cellspacing="0" cellpadding="0" border="0">
<tbody>
<tr>
<td valign="bottom">
<div id="zonemenu">
<table cellspacing="0" cellpadding="0" border="0">
<div tal:omit-tag="" tal:define="level (0,{});sub getMainRubric()" tal:condition="sub">
<tr metal:use-macro="macro.tal/treemenu"/>
</div>
<tr tal:condition="not user" tal:on-error="nothing"
tal:repeat="role [GlasnostServerRole('tasks'), GlasnostServerRole('appointments')]">
<td><img tal:reroot="src" src="/images/arbopics/arb0.png" width="10" height="22" /></td>
<td><img tal:reroot="src" src="/images/arbopics/arb-.png" width="15" height="22" /></td>
<td><img tal:reroot="src" src="/images/arbopics/arbp0.png" width="15" height="22" /></td>
<td colspan="20">
<a tal:attributes="href role.url" tal:content="role.label">server</a>
</td>
</tr>
<!-- rubric de l'utilisateur logge -->
<div tal:omit-tag="" tal:on-error="nothing" tal:condition="user">
<tr>
<td><img src="/images/arbopics/arb0.png" width=10 height=22 border=0></td>
<td><img src="/images/arbopics/arb-.png" width=15 height=22 border=0></td>
<td><img src="/images/arbopics/arbp0.png" width=15 height=22 border=0></td>
<td colspan="20">
<a tal:attributes="href roleUrl(user.login)" tal:content="user.login"/>
</td>
</tr>
<div tal:omit-tag="" tal:define="level (1,{});sub GlasnostObject(getWebForServerRole('pagenames').getIdByName(user.login))"
tal:condition="sub">
<tr metal:use-macro="macro.tal/treemenu"/>
</div>
</div>
<tr metal:use-macro="macro.tal/serverRolesMenu"/>
<tr tal:condition="not user">
<td><img tal:reroot="src" src="/images/arbopics/arb0.png" width="10" height="22" /></td>
<td><img tal:reroot="src" src="/images/arbopics/arb-.png" width="15" height="22" /></td>
<td><img tal:reroot="src" src="/images/arbopics/arbp0.png" width="15" height="22" /></td>
<td colspan="20">
<span metal:use-macro="buttons.tal/login" />
</td>
</tr>
<tr tal:condition="user">
<td><img tal:reroot="src" src="/images/arbopics/arb0.png" width="10" height="22" /></td>
<td><img tal:reroot="src" src="/images/arbopics/arb-.png" width="15" height="22" /></td>
<td><img tal:reroot="src" src="/images/arbopics/arbp0.png" width="15" height="22" /></td>
<td colspan="20">
<span metal:use-macro="buttons.tal/preferences" />
</td>
</tr>
<tr tal:condition="user">
<td><img tal:reroot="src" src="/images/arbopics/arb0.png" width="10" height="22" /></td>
<td><img tal:reroot="src" src="/images/arbopics/arb-.png" width="15" height="22" /></td>
<td><img tal:reroot="src" src="/images/arbopics/arbp0.png" width="15" height="22" /></td>
<td colspan="20">
<span metal:use-macro="buttons.tal/admin" />
</td>
</tr>
<tr tal:condition="user">
<td><img tal:reroot="src" src="/images/arbopics/arb0.png" width="10" height="22" /></td>
<td><img tal:reroot="src" src="/images/arbopics/arb-.png" width="15" height="22" /></td>
<td><img tal:reroot="src" src="/images/arbopics/arbp0.png" width="15" height="22" /></td>
<td colspan="20">
<span metal:use-macro="buttons.tal/logout" />
</td>
</tr>
</table>
</div>
</td>
</tr>
</tbody>
</table>
</td><td>
</td></tr><tr><td valign="top">
<center>
<table width="90%" cellspacing="0" cellpadding="0" border="0">
<tbody>
<tr><td>
<div id="zonecontent">
<div metal:define-slot="main">
C'est ici que viendra le contenu du tag ayant l'attribu
<a href="http://www.codelutin.com/">
<img tal:reroot="src" src="/images/lutin-title.png"
alt="CodeLutin.org"
width=443 height=95 hspace=4 vspace=6 align="bottom" border=0>
</a>
</div>
</div>
</td></tr>
</tbody>
</table>
</center>
<span id="zonemenu">
<div class="menu">
<ul tal:define="sub getMainRubric()" tal:condition="sub">
<li metal:use-macro="macro.tal/treemenu"/>
</ul>
<!-- rubric de l'utilisateur logge -->
<ul tal:on-error="nothing" tal:condition="user">
<li class="menu-open">
<a class="menu-label" tal:attributes="href url(user.login)"
tal:content="user.login"/>
<ul tal:define="sub GlasnostObject(getWebForServerRole('pagenames').getIdByName(user.login))"
tal:condition="sub">
<li metal:use-macro="macro.tal/treemenu"/>
</ul>
</li>
</ul>
<ul>
<li class="menu-open">
<span class="menu-label">Serveur</span>
<ul metal:use-macro="macro.tal/serverRolesMenu"></ul>
</li>
<li class="menu-leaf" tal:condition="not user">
<a class="menu-label" href="/login">S'identifier</a>
</li>
<li class="menu-leaf" tal:condition="user">
<a class="menu-label" href="/preferences">Préférence</a>
</li>
<li class="menu-leaf" tal:condition="user">
<a class="menu-label" href="/admin">Réglage</a>
</li>
<li class="menu-leaf" tal:condition="user">
<a class="menu-label" href="/login/logout">Sortir</a>
</li>
</ul>
</div> <!-- treemenu -->
</span> <!-- zone menu -->
<span id="zonecontent">
<div metal:define-slot="main">
C'est ici que viendra le contenu du tag ayant l'attribu
</div>
</span> <!-- zone content -->
</td></tr><tr><td colspan="2">
<div id="zonefooter">
<center>
<div id="zonefooter">
<center>
&nbsp;<br/>
<hr width="50%" />
<small><font color="#315177">
@ -181,11 +102,7 @@ T&eacute;l.:&nbsp;+33&nbsp;(0)2&nbsp;40&nbsp;50&nbsp;29&nbsp;28<br/>
e-mail:
<a href="mailto:info@codelutin.com">info@codelutin.com</a>
</font></small></center>
</div>
</td></tr>
</tbody>
</table>
</div> <!-- zone footer -->
<p metal:use-macro="misc.tal/poweredBy" />
</body>

View File

@ -1,57 +1,31 @@
<div tal:omit-tag="" tal:define="treemenu loadExtension('treemenu');level treemenu.upLevel(level)" metal:define-macro="treemenu" id="tree-menu"
tal:condition="sub and sub.getThingName() == 'rubrics.Rubric'"
tal:repeat="sub getSetContainedObjects(sub.membersSet, ['rubrics', 'articles', 'directories'])">
<div tal:omit-tag="" tal:define="treemenu loadExtension('treemenu')"
metal:define-macro="treemenu"
tal:condition="sub and sub.getThingName() == 'rubrics.Rubric'"
tal:repeat="sub getSetContainedObjects(sub.membersSet, ['rubrics', 'articles', 'directories'])">
<div tal:omit-tag=""
tal:define="level treemenu.updateLevel(level, repeat_sub.end);objectPath getPathToObject(currentObject); cond treemenu.haveChild(currentObject, sub, objectPath)">
<tr valign="top">
<td><img src="/images/codelutin.org/arbopics/arb0.png" width=10 height=22 border=0></td>
<div tal:omit-tag="" tal:repeat="b range(1, level[0])">
<td><img src="/images/codelutin.org/arbopics/arb0.png" width=10 height=22 border=0></td>
<td tal:condition="b+1 <> level[0] and treemenu.isLast(level, b+1)">
<img src="/images/codelutin.org/arbopics/arb0.png" width=10 height=22 border=0>
</td>
<td background="/images/codelutin.org/arbopics/arbI.png"
style="background-repeat:repeat-y"
tal:condition="b+1 <> level[0] and not treemenu.isLast(level, b+1)">
<img src="/images/codelutin.org/arbopics/arbI.png" width=15 height=22 border=0>
</td>
<td tal:condition="b+1 == level[0] and treemenu.isLast(level, b+1)">
<img src="/images/codelutin.org/arbopics/arbL.png" width=15 height=22 border=0>
</td>
<td background="/images/codelutin.org/arbopics/arbI.png"
style="background-repeat:repeat-y"
tal:condition="b+1 == level[0] and not treemenu.isLast(level, b+1)">
<img src="/images/codelutin.org/arbopics/arbT.png" width=15 height=22 border=0>
</td>
</div>
<td background="/images/codelutin.org/arbopics/arb-.png" style="background-repeat:repeat-x"><img src="/images/codelutin.org/arbopics/arb-.png" width=15 height=22 border=0></td>
<td tal:condition="not cond"><img src="/images/codelutin.org/arbopics/arbp0.png" width=15 height=22 border=0></td>
<td tal:condition="cond"><img src="/images/codelutin.org/arbopics/arbp1.png" width=15 height=22 border=0></td>
<td tal:attributes="colspan 20-2*level[0]">
<a tal:attributes="href sub.getUrl()"
tal:content="sub.label"
tal:on-error="nothing">SubRubric</a>
</td>
</tr>
<div tal:condition="cond" tal:omit-tag="">
<div metal:use-macro="macro.tal/treemenu" />
</div>
tal:define="objectPath getPathToObject(currentObject); menuclass treemenu.getClass(sub);cond treemenu.haveChild(currentObject, sub, objectPath)">
<li tal:attributes="class menuclass" tal:condition="not cond">
<a class="menu-label"
tal:attributes="href sub.getUrl()"
tal:content="sub.label"
tal:on-error="nothing">SubRubric</a>
</li>
<li tal:attributes="class menuclass" tal:condition="cond" tal:on-error="nothing">
<a class="menu-label"
tal:attributes="href sub.getUrl()" tal:content="sub.label"/>
<ul>
<div metal:use-macro="macro.tal/treemenu" />
</ul>
</li>
</div>
</div>
<tr metal:define-macro="serverRolesMenu" id="serverRolesMenu"
tal:condition="user"
tal:repeat="labelAndLink getGotoObjectsLabelsAndLinks()">
<td><img src="/images/codelutin.org/arbopics/arb0.png" width=10 height=22 border=0></td>
<td><img src="/images/codelutin.org/arbopics/arb-.png" width=15 height=22 border=0></td>
<td><img src="/images/codelutin.org/arbopics/arbp0.png" width=15 height=22 border=0></td>
<td colspan="20">
<a tal:attributes="href labelAndLink[1]"
tal:content="labelAndLink[0]">server</a>
</td>
</tr>
<ul metal:define-macro="serverRolesMenu" tal:condition="user">
<li class="menu-leaf"
tal:repeat="role [x for x in getServerRoles() if canGetObjects(x)]">
<a class="menu-label"
tal:attributes="href role.url"
tal:content="role.label">server</a>
</li>
</ul>

View File

@ -1,13 +1,12 @@
@import "menu.css";
body {
font-family: Verdana, Arial, Georgia, Geneva, sans-serif;
font-family: Verdana, Arial, Georgia, Geneva ;
background-image: url(/images/lutin-background.png);
background-repeat: no-repeat;
background-color : white;
color: black;
margin: 0;
padding:0;
background-color : #FFFFFF;
margin: 0px;
padding:0px;
}
a:link, a:visited {
@ -81,3 +80,135 @@ th {
content: "*";
color: red;
}
#zonetitle {
float: left;
width: 100%;
}
#zonemenu {
float: left;
width: 20%;
}
#zonecontent {
float: right;
width: 80%;
}
#zonefooter {
float: left;
width: 100%;
}
/*
.treemenu {
white-space: nowrap;
}
.treemenu * {
vertical-align: middle;
margin: 0px 0px 0px 0px;
padding: 0px 0px 0px 0px;
}
.menu-label {
display: table-cell;
white-space: normal;
}
.treepicture {
display: table-cell;
height: 100%;
}
.treepicture span {
height: 100%;
}
.treepicture-I, .treepicture-L , .treepicture-T{
width: 11px;
height: 100%;
}
*/
/*
span.treepicture-p1{
white-space: pre;
}
*/
/*** Nav bar styles ***/
div.treemenu ul#nav,
div.treemenu #nav ul{
/*Remove all spacings from the list items*/
margin: 0;
padding: 0;
cursor: default;
list-style-type: none;
}
/*
div.treemenu ul#nav{
// max-width: 40ex;
width: 17ex;
/*Optional, to make the navigation bar positions on the left of the content*/
// float: left;
margin-right: 1em;
}
div.treemenu ul>li{
margin: 0;
padding: 2px 6px;
}
div.treemenu ul#nav li>ul{
display: none;
position: absolute;
// max-width: 40ex;
width: 30ex;
left: 17ex;
margin-top: -1.4em;
margin-left: 0px;
}
div.treemenu ul#nav li:hover>ul{
display : block;
}
div.treemenu #nav ul li a{
display: block;
padding: 2px 10px;
}
*/
/*** Menu styles (customizable) ***/
/*
div.treemenu ul#nav,
div.treemenu #nav ul,
div.treemenu #nav ul li a{
background-color: #fff;
color: #369;
}
div.treemenu ul#nav li:hover,
div.treemenu #nav ul li a:hover{
background-color: #369;
color: #fff;
}
div.treemenu ul#nav li:active,
div.treemenu #nav ul li a:active{
background-color: #036;
color: #fff;
}
div.treemenu ul{
border: 1px solid #369;
}
div.treemenu #nav a{
text-decoration: none;
}
*/

View File

@ -0,0 +1,74 @@
.menu-label {
color: black;
color: #113d60;
color: #08223C;
display: block;
text-decoration: none;
}
/*
.menu-label:before {
content: " ";
}
*/
.menu-label:hover {
color: white;
}
.menu-label:active {
color: #f9cc70;
}
.menu {
margin: 1em;
display: block;
color: #000000;
}
.menu ul {
margin: -1px -1px -1px -1px;
padding-left: 0.4em; /* decalage entre les different niveau (depth) */
}
.menu li {
width: 7em;
padding-left: 0.6em;
margin-top: -1px;
border-top: 1px #000000 solid;
border-right: 2px #000000 solid;
border-right: 1px #000000 solid;
border-bottom: 0;
border-left: 0;
}
.menu li.menu-open { list-style-image: url(/images/menu/puce-open.rol.gif); }
.menu li.menu-close { list-style-image: url(/images/menu/puce-close.rol.gif); }
.menu li.menu-leaf { list-style-image: url(/images/menu/puce-leaf.rol.gif); }
.menu li.menu-open:hover { list-style-image: url(/images/menu/puce-open.gif); }
.menu li.menu-close:hover { list-style-image: url(/images/menu/puce-close.gif); }
.menu li.menu-leaf:hover { list-style-image: url(/images/menu/puce-leaf.gif); }
//.menu li { background: #fff url(/images/menu/grada2.png) repeat-x top; }
.menu li { background: #fff url(/images/menu/grada1.png) repeat-x top; }
.menu li li { background: #fff url(/images/menu/grada2.png) repeat-x top; }
.menu li li li { background: #fff url(/images/menu/grada3.png) repeat-x top; }
.menu li li li li { background: #fff url(/images/menu/grada4.png) repeat-x top; }
.menu li li li li li { background: #fff url(/images/menu/grada5.png) repeat-x top; }
.menu li li li li li li { background: #fff url(/images/menu/grada6.png) repeat-x top; }
.menu li li li li li li li { background: #fff url(/images/menu/grada7.png) repeat-x top; }
.menu li li li li li li li li { background: #fff url(/images/menu/grada8.png) repeat-x top; }
.menu li li li li li li li li li { background: #fff url(/images/menu/grada9.png) repeat-x top; }
//.menu li:hover { background: #fff url(/images/menu/grada2.rol.png) repeat-x top; }
.menu li:hover { background: #fff url(/images/menu/grada1.rol.png) repeat-x top; }
.menu li li:hover { background: #fff url(/images/menu/grada2.rol.png) repeat-x top; }
.menu li li li:hover { background: #fff url(/images/menu/grada3.rol.png) repeat-x top; }
.menu li li li li:hover { background: #fff url(/images/menu/grada4.rol.png) repeat-x top; }
.menu li li li li li:hover { background: #fff url(/images/menu/grada5.rol.png) repeat-x top; }
.menu li li li li li li:hover { background: #fff url(/images/menu/grada6.rol.png) repeat-x top; }
.menu li li li li li li li:hover { background: #fff url(/images/menu/grada7.rol.png) repeat-x top; }
.menu li li li li li li li li:hover { background: #fff url(/images/menu/grada8.rol.png) repeat-x top; }
.menu li li li li li li li li li:hover { background: #fff url(/images/menu/grada9.rol.png) repeat-x top; }

Binary file not shown.

After

Width:  |  Height:  |  Size: 83 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 161 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 187 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 191 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 194 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 185 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 193 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 192 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 189 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 175 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 188 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 175 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 185 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 176 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 188 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 172 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 194 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 175 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 189 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 174 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 197 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 180 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 195 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 194 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 192 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 80 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 80 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 76 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 76 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 78 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 78 B