<!DOCTYPE html
    PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:xi="http://www.w3.org/2001/XInclude"
      xmlns:py="http://genshi.edgewall.org/"
      xmlns:i18n="http://genshi.edgewall.org/i18n"
      py:strip="">

  <div py:def="navigation(category)" id="${category}" class="nav">
    <ul py:if="chrome.nav[category]">
      <li py:for="idx, item in  enumerate(chrome.nav[category])"
          class="${classes(first_last(idx, chrome.nav[category]), active=item.active)}">${item.label}</li>
    </ul>
  </div>

  <py:match path="body" once="true" buffer="false"><body>
    <div id="banner">
      <div id="header" py:choose="">
        <a py:when="chrome.logo.src" id="logo" href="${chrome.logo.link or href.wiki('TracIni')+'#header_logo-section'}"><img
          src="${chrome.logo.src}" alt="${chrome.logo.alt}"
          height="${chrome.logo.height or None}" width="${chrome.logo.width or None}" /></a>
        <h1 py:otherwise=""><a href="${chrome.logo.link}">${project.name}</a></h1>
      </div>
      <form id="search" action="${href.search()}" method="get">
        <div py:if="not defined('trac_error_rendering') and 'SEARCH_VIEW' in perm">
          <label for="proj-search">Search:</label>
          <input type="text" id="proj-search" name="q" size="18" accesskey="f" value="" />
          <input type="submit" value="${_('Search')}" />
        </div>
      </form>
      ${navigation('metanav')}
    </div>
    ${navigation('mainnav')}

    <div id="main">
      <xi:include py:if="value_of('resourcepath_template')" href="${resourcepath_template}" />

      <div id="ctxtnav" class="nav">
        <h2>Context Navigation</h2>
          <ul py:if="chrome.ctxtnav">
              <li py:for="i, elm in enumerate(chrome.ctxtnav)"
                  class="${classes(first_last(i, chrome.ctxtnav))}">$elm</li>
          </ul>
        <hr />
      </div>

      <div id="warning" py:if="chrome.warnings" class="system-message">
        <py:choose test="len(chrome.warnings)">
          <strong>Warning:</strong>
          <py:when test="1">${chrome.warnings[0]}</py:when>
          <py:otherwise><ul><li py:for="warning in chrome.warnings">$warning</li></ul></py:otherwise>
        </py:choose>
      </div>
      <div id="notice" py:if="chrome.notices" class="system-message">
        <py:choose test="len(chrome.notices)">
          <py:when test="1">${chrome.notices[0]}</py:when>
          <py:otherwise><ul><li py:for="notice in chrome.notices">$notice</li></ul></py:otherwise>
        </py:choose>
      </div>

      ${select('*|text()|comment()')}
    </div>

    <div id="footer" xml:lang="en"><hr/>
      <a id="tracpowered" href="http://trac.edgewall.org/"><img
        src="${chrome.htdocs_location}trac_logo_mini.png" height="30"
        width="107" alt="Trac Powered"/></a>
      <p class="left" i18n:msg="version">
        Powered by <a href="${href.about()}"><strong>Trac ${trac.version}</strong></a><br />
        By <a href="http://www.edgewall.org/">Edgewall Software</a>.
      </p>
      <p class="right">${chrome.footer}</p>
    </div>
  </body></py:match>
</html>
