Mercurial > genshi > mirror
comparison examples/trac/templates/layout.html @ 56:6474226bb8b6 trunk
Trac port: use a function to build mainnav/metanav.
author | cmlenz |
---|---|
date | Tue, 04 Jul 2006 13:36:37 +0000 |
parents | 1340e3297d19 |
children | 448792ab1303 |
comparison
equal
deleted
inserted
replaced
55:f722c43f36d7 | 56:6474226bb8b6 |
---|---|
8 <title>${select('title/text()')} – Trac</title> | 8 <title>${select('title/text()')} – Trac</title> |
9 <div py:for="rel, links in chrome.links.items()" py:strip=""> | 9 <div py:for="rel, links in chrome.links.items()" py:strip=""> |
10 <link rel="${rel}" py:for="link in links" py:attrs="link"/> | 10 <link rel="${rel}" py:for="link in links" py:attrs="link"/> |
11 </div> | 11 </div> |
12 <script py:for="script in chrome.scripts" | 12 <script py:for="script in chrome.scripts" |
13 type="${script.type}" src="${script.href}"/> | 13 type="${script.type}" src="${script.href}"></script> |
14 </head> | 14 </head> |
15 | |
16 <div py:def="navigation(category)" id="${category}" class="nav"> | |
17 <ul py:if="chrome.nav[category]"> | |
18 <li py:for="idx, item in enumerate(chrome.nav[category])" | |
19 class="${' '.join(filter(None, [ | |
20 (idx == 0) and 'first', | |
21 (idx == len(chrome.nav[category]) - 1) and 'last' | |
22 ])) or None}">${HTML(item.label)}</li> | |
23 </ul> | |
24 </div> | |
15 | 25 |
16 <body py:match="body"> | 26 <body py:match="body"> |
17 <div id="banner"> | 27 <div id="banner"> |
18 <div id="header"> | 28 <div id="header"> |
19 <a id="logo" py:if="chrome.logo.src" href="${chrome.logo.link}"><img | 29 <a id="logo" py:if="chrome.logo.src" href="${chrome.logo.link}"><img |
20 src="${chrome.logo.src}" /></a> | 30 src="${chrome.logo.src}" /></a> |
21 </div> | 31 </div> |
22 <form py:if="'SEARCH_VIEW' in perm" id="search" | 32 <form py:if="'SEARCH_VIEW' in perm" id="search" |
23 action="${href.search()}" method="get"> | 33 action="${href.search()}" method="get"><div> |
24 <div> | |
25 <label for="proj-search">Search:</label> | 34 <label for="proj-search">Search:</label> |
26 <input type="text" id="proj-search" name="q" size="10" accesskey="f" value="" /> | 35 <input type="text" id="proj-search" name="q" size="10" accesskey="f" value="" /> |
27 <input type="submit" value="Search" /> | 36 <input type="submit" value="Search" /> |
28 <input type="hidden" name="wiki" value="on" /> | 37 <input type="hidden" name="wiki" value="on" /> |
29 <input type="hidden" name="changeset" value="on" /> | 38 <input type="hidden" name="changeset" value="on" /> |
30 <input type="hidden" name="ticket" value="on" /> | 39 <input type="hidden" name="ticket" value="on" /> |
31 </div> | 40 </div></form> |
32 </form> | 41 ${navigation('metanav')} |
33 <div id="metanav" class="nav"> | |
34 <ul py:if="chrome.nav.metanav"> | |
35 <li py:for="idx, item in enumerate(chrome.nav.metanav)" | |
36 py:content="HTML(item.label)" | |
37 class="${' '.join(filter(None, [ | |
38 (idx == 0) and 'first', | |
39 (idx == len(chrome.nav.metanav) - 1) and 'last' | |
40 ])) or None}"/> | |
41 </ul> | |
42 </div> | |
43 </div> | 42 </div> |
44 <div id="mainnav" class="nav"> | 43 ${navigation('mainnav')} |
45 <ul py:if="chrome.nav.mainnav"> | |
46 <li py:for="idx, item in enumerate(chrome.nav.mainnav)" | |
47 py:content="HTML(item.label)" | |
48 class="${' '.join(filter(None, [ | |
49 (idx == 0) and 'first', | |
50 (idx == len(chrome.nav.mainnav) - 1) and 'last' | |
51 ])) or None}"/> | |
52 </ul> | |
53 </div> | |
54 | 44 |
55 <div id="main"> | 45 <div id="main"> |
56 ${select('*')} | 46 ${select('*')} |
57 | 47 |
58 <div id="altlinks" py:if="chrome.links.alternate"> | 48 <div id="altlinks" py:if="chrome.links.alternate"> |
74 <p class="left"> | 64 <p class="left"> |
75 Powered by <a href="${href.about()}"><strong>Trac ${chrome.version}</strong></a><br /> | 65 Powered by <a href="${href.about()}"><strong>Trac ${chrome.version}</strong></a><br /> |
76 By <a href="http://www.edgewall.com/">Edgewall Software</a>. | 66 By <a href="http://www.edgewall.com/">Edgewall Software</a>. |
77 </p> | 67 </p> |
78 <p class="right"> | 68 <p class="right"> |
79 ${HTML(config.project.get('footer'))} | 69 ${chrome.footer} |
80 </p> | 70 </p> |
81 </div> | 71 </div> |
82 </body> | 72 </body> |
83 | 73 |
84 </html> | 74 </html> |