templates/layout.tmpl
changeset 12 2abc5ace0b15
parent 11 fa216534ae45
child 20 d40c339d3778
equal deleted inserted replaced
11:fa216534ae45 12:2abc5ace0b15
     1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
     1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
       
     2 
       
     3 <%def name="render_menu(open_page, page, items, ancestry)">
       
     4 <ul>
       
     5 % for pi in items :
       
     6     <li>
       
     7         <a href="${site_page_url}/${pi.url}"${' class="selected-page"' if pi == open_page else ''}>${pi.title} ${'&raquo;' if pi.children and pi.parent else ''}</a>
       
     8     % if pi in ancestry and pi.children and pi.parent :
       
     9         ${render_menu(page, pi, pi.children, ancestry)}
       
    10     % endif
       
    11     </li>
       
    12 % endfor
       
    13 </ul>
       
    14 </%def>
     2 
    15 
     3 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
    16 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
     4     <head>
    17     <head>
     5         <title>qmsk.net :: ${page.title}</title>
    18         <title>qmsk.net :: ${page.title}</title>
     6         <link rel="Stylesheet" type="text/css" href="${site_root_url}/static/style.css" />
    19         <link rel="Stylesheet" type="text/css" href="${site_root_url}/static/style.css" />
     7     </head>
    20     </head>
     8     <body>
    21     <body>
     9             <div id="header">
    22             <div id="header">
    10                 <a href="${site_page_url}/">QMSK.NET</a>
    23                 <a href="${site_page_url}/">QMSK.NET</a>
    11             </div>
    24             </div>
    12  
    25             
    13             <ul id="nav">
    26             <div id="nav">
    14             % if menu.page.parent and menu.page.parent.parent :
    27                 ${render_menu(menu.page, menu.page, menu.items, menu.ancestry)}
    15                 <li><a href="${site_page_url}/${menu.page.parent.url}">&laquo;</a></li>
    28             </div>
    16             % endif
       
    17             % for pi in menu.items :
       
    18                 <li><a href="${site_page_url}/${pi.url}"${' class="selected-page"' if pi.url == page.url else ''}>${pi.title} ${'&raquo;' if pi.children and pi.parent else ''}</a></li>
       
    19             % endfor
       
    20             </ul>
       
    21 
    29 
    22             <div id="content">
    30             <div id="content">
    23                 ${page.content}
    31                 ${page.content}
    24             </div>
    32             </div>
    25     </body>
    33     </body>