<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
                      "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:py="http://genshi.edgewall.org/"
      xmlns:xi="http://www.w3.org/2001/XInclude"
      py:strip="">
<head py:match="head" py:attrs="select('@*')">
    <meta content="text/html; charset=UTF-8" http-equiv="content-type" py:replace="''"/>
    <title py:replace="''">Your title goes here</title>
    <meta py:replace="select('*')"/>
    <link rel="shortcut icon" type="image/x-icon" href="${g.plugins['theme'].theme_url('favicon.ico')}"/>
    <link rel="stylesheet" type="text/css" media="screen" href="${tg.url('/css/style.css')}" />
    <link rel="stylesheet" type="text/css" media="screen" href="${g.plugins['theme'].theme_url('main.css')}" />

</head>

<?python
    if not defined('page'):
        page = None
?>

<body py:match="body" py:attrs="select('@*')">
  <div py:if="request.identity" id="acr_admin_menu">
    <ul>
      <li><a href="${tg.url('/logout_handler')}">LOGOUT</a></li>
      <li><a href="${h.acr_url('/plugins/chpasswd')}">CHANGE PASSWORD</a></li>
      <li py:if="h.user_in_group('managers') or h.user_in_group('acr')"><a href="${h.acr_url('/admin')}">ADMIN</a></li>
      <li py:if="(h.user_in_group('managers') or h.user_in_group('acr')) and page">
        <a href="#" onclick="return acr_show_menu(this);">PAGE SCRIPTS</a>
        ${h.render_scripts_menu(page)}
      </li>
      <li py:if="(h.user_in_group('managers') or h.user_in_group('acr')) and page">
        <a href="#" onclick="return acr_show_menu(this);">ADD SLICE</a>
        ${h.render_slices_menu(page)}
      </li>
    </ul>
    <div class="clearfix" />
  </div>

   <py:with vars="flash=tg.flash_obj.render('flash', use_js=False)">
     <div py:if="flash" class="span-24" py:content="XML(flash)" />
   </py:with>

   <div class="container">
    <div id="header">
        ${h.draw_section(page, 'header')}
    </div>

    <div id="page">
        <div id="leftbar">${h.draw_section(page, 'leftbar')}</div>
        <div id="main" py:content="select('*|text()')" />
        <div id="rightbar">${h.draw_section(page, 'rightbar')}</div>
        <div id="page_terminator"></div>
    </div>

    <div id="footer">
        ${h.draw_section(page, 'footer')}
    </div>
  </div>
</body>
</html>
