<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:py="http://genshi.edgewall.org/"
      xmlns:xi="http://www.w3.org/2001/XInclude">
  <xi:include href="master.html" />
  <xi:include href="../misc/paginate.html" />
<head>
	<link rel="stylesheet" type="text/css" media="screen" href="${tg.url('/css/progress.css')}" />
	<title>Events</title>
</head>
<body>
	<div id="content" style="margin-left: 20px;">
		<h2>Events</h2>
		<form action="" method="get">
			<p class="table_filter">
				<strong>Status:</strong><br />
				<select id="status" name="status" onchange="this.form.submit()">
					<option value=""></option>
					<option py:for="status in statuses"
					        py:content="status"
							py:attrs="dict(selected=(status==kw['status'] and 'selected' or None))"></option>
				</select>
			</p>
			<p class="table_filter">
				<strong>Dispatch:</strong><br />
				<select id="dispatch_id" name="dispatch_id" onchange="this.form.submit()">
					<option value=""></option>
					<option py:for="(dispatch_id, dispatch_name) in dispatchs"
					        py:content="dispatch_name"
							py:attrs="dict(selected=(dispatch_id==kw['dispatch_id'] and 'selected' or None), value=dispatch_id)"></option>
				</select>
			</p>
			<p class="table_filter">
				<strong>Tube:</strong><br />
				<select id="tube_id" name="tube_id" onchange="this.form.submit()">
					<option value=""></option>
					<option py:for="(tube_id, tube_name) in tubes"
					        py:content="tube_name"
							py:attrs="dict(selected=(tube_id==kw['tube_id'] and 'selected' or None), value=tube_id)"></option>
				</select>
			</p>
		    <span py:if="tmpl_context.paginators and tmpl_context.paginators.value_list.page_count > 1"
			      py:strip="True"
		          py:content="paginate_nav(tmpl_context.paginators.value_list, kwargs=kw)"/>
			<br style="clear: both;" />
				${XML(tmpl_context.widget(value=[line_formater(v) for v in value_list], action='../'+model.lower()+'s.json'))}
		    <span py:if="tmpl_context.paginators and tmpl_context.paginators.value_list.page_count > 1"
			      py:strip="True"
		          py:content="paginate_nav(tmpl_context.paginators.value_list, kwargs=kw)"/>
		</form>
	</div>
</body>
</html>
