<html xmlns:py="http://genshi.edgewall.org/"
      xmlns:xi="http://www.w3.org/2001/XInclude"
      py:strip="">

  <?python from allura.lib.security import has_neighborhood_access ?>
  <py:def function="nav_menu()">
    <div id="nav_menu_missing" py:if="not c.project.neighborhood"/>
    <py:if test="c.project.neighborhood">
	<div class="column grid_1">
        <img py:if="c.project.neighborhood.icon" src="${c.project.neighborhood.url()}/icon" class="project_icon"/>
        <img py:if="not c.project.neighborhood.icon" src="${g.forge_static('images/project_default.png')}" class="project_icon"/>
	</div>
	<div class="column grid_9">
		<h1>
		<a href="${c.project.neighborhood.url()}">$c.project.neighborhood.name</a><br/>
		</h1>
	</div>
	<div class="column grid_2">&nbsp;</div>
	</py:if>
  </py:def>

  <py:def function="top_nav()">
		<div class="row project" py:if="c.project.neighborhood">
			<div class="column grid_9">
				<ul class="ui-tab">
				  <li class="${request.url.rfind(c.project.neighborhood.url(),-len(c.project.neighborhood.url())) != -1 and 'active' or ''}">
            <a href="${c.project.neighborhood.url()}" class="ico-l"><b class="ui-icon ui-icon-home"></b> <span>Home</span></a>
          </li>
					<li py:if="has_neighborhood_access('admin', c.project.neighborhood)()"
					    class="${c.project.neighborhood.url()+'_admin' in request.url and 'active' or ''}">
              <a href="${c.project.neighborhood.url()}_admin/" class="ico-l"><b class="ui-icon ui-icon-gear"></b> <span>Admin</span></a>
					</li>
					<li py:if="has_neighborhood_access('moderate', c.project.neighborhood)()"
					    class="${c.project.neighborhood.url()+'_moderate' in request.url and 'active' or ''}">
              <a href="${c.project.neighborhood.url()}_moderate/" class="ico-l"><b class="ui-icon ui-icon-gear"></b> <span>Moderate</span></a>
					</li>
				</ul>
			</div>
		</div>
  </py:def>
</html>
