<!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>${_("%s | PyF Services") % select('title/text()')}</title>
		<link rel="stylesheet" type="text/css" media="screen" href="${tg.url('/css/style.css')}" />
		<link rel="stylesheet" type="text/css" media="screen" href="${tg.url('/css/pagination.css')}" />
		<script type="text/javascript" src="${tg.url('/scripts/mootools-1.2.3-core-yc.js')}"></script>
		<script type="text/javascript" src="${tg.url('/scripts/mootools-1.2.3-more-yc.js')}"></script>
		<!--[if lte IE 7]>
		 <script src="/scripts/IE8.js" type="text/javascript"></script>
		 <script src="/scripts/ie7-recalc.js" type="text/javascript"></script>
		<![endif]-->
		<meta py:replace="select('*')"/>
</head>

<body py:match="body" py:attrs="select('@*')">
	<div id="header">
		<h1><a href="${tg.url('/')}" id="home">PyF</a></h1>
		<ul id="mainmenu">
			<li class="first single" py:if="request.identity">
				<a href="${tg.url('/')}"><span>Dashboard</span></a>
			</li>
			<li class="first single" py:if="request.identity and ('manage' in request.identity['permissions'] or 'eventtrack_view' in request.identity['permissions'])">
                <a href="${tg.url('/events/')}" class="first">
                    <span>Event Log</span></a>
            </li>
            <li class="first single" py:if="request.identity and ('manage' in request.identity['permissions'] or 'tubetask_view' in request.identity['permissions'])">
                <a href="${tg.url('/tasks/')}" class="first">
                    <span>Tasks</span></a>
            </li>
			<li class="group" py:if="request.identity">
				<span class="grouplabel">Data Entry</span>
				<a href="${tg.url('/dispatchs')}" class="first"
                py:if="'manage' in request.identity['permissions'] or 'dispatch_view' in request.identity['permissions']">
                    <span>Dispatchs</span></a>
                <a href="${tg.url('/descriptors')}" class="last"
                py:if="'manage' in request.identity['permissions'] or 'descriptor_view' in request.identity['permissions']">
                    <span>Descriptors</span></a>
			</li>
			<li class="group" py:if="request.identity">
				<span class="grouplabel">Core</span>
                <a href="${tg.url('/tubes')}" class="first"
                py:if="'manage' in request.identity['permissions'] or 'tube_view' in request.identity['permissions']">
                    <span>Tubes</span></a>
                <a href="${tg.url('/tubelayers')}" class="last"
                py:if="'manage' in request.identity['permissions'] or 'tubelayer_view' in request.identity['permissions']">
                    <span>Layers</span></a>
            </li>
            <li class="group" py:if="request.identity and 'manage' in request.identity['permissions']">
				<span class="grouplabel">Administration</span>
                <a href="${tg.url('/users')}" class="first">
                    <span>Users</span>
                </a>
                <a href="${tg.url('/groups')}" class="">
                    <span>Groups</span>
                </a>
                <a href="${tg.url('/permissions')}" class="last">
                    <span>Permissions</span>
                </a>
            </li>
			<li id="login" class="last single">
				<a py:if="not request.identity" href="${tg.url('/login')}"><span>Login</span></a>
				<a py:if="request.identity" href="${tg.url('/logout_handler')}"><span>Logout</span></a>
			</li>
		</ul>
	</div>
	<py:with vars="flash=tg.flash_obj.render('flash', use_js=False)">
			<div py:if="flash" py:content="XML(flash)" />
	</py:with>
	<h2 py:match="h1" py:content="select('*|text()')" />
	<div py:replace="select('*|text()')"/>
	<!--[if lte IE 7]>
	<br style="clear: both;" />
	<![endif]-->
	<div id="footer"> 
		<div id="status">...</div>
	</div>
</body>
</html>
