#*
 * Copyright 2012 LinkedIn Corp.
 * 
 * Licensed under the Apache License, Version 2.0 (the "License"); you may not
 * use this file except in compliance with the License. You may obtain a copy of
 * the License at
 * 
 * http://www.apache.org/licenses/LICENSE-2.0
 * 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
 * License for the specific language governing permissions and limitations under
 * the License.
*#

<!DOCTYPE html> 
<html>
	<head lang="en">

#parse("azkaban/webapp/servlet/velocity/style2.vm")
#parse("azkaban/webapp/servlet/velocity/javascript.vm")

		<script type="text/javascript" src="${context}/js/jqueryui/jquery-ui-1.10.1.custom.js"></script>
		
		<script type="text/javascript" src="${context}/js/dust-core-2.2.2.min.js"></script>
		<script type="text/javascript" src="${context}/js/flowsummary.js"></script>
		<script type="text/javascript" src="${context}/js/azkaban.date.utils.js"></script>
		<script type="text/javascript" src="${context}/js/azkaban.ajax.utils.js"></script>
		<script type="text/javascript" src="${context}/js/azkaban.common.utils.js"></script>
		<script type="text/javascript" src="${context}/js/azkaban.nav.js"></script>
		<script type="text/javascript" src="${context}/js/azkaban.layout.js"></script>
		<script type="text/javascript" src="${context}/js/azkaban.flow.job.view.js"></script>
		<script type="text/javascript" src="${context}/js/azkaban.flow.graph.view.js"></script>
		<script type="text/javascript" src="${context}/js/azkaban.flow.view.js"></script>
		<script type="text/javascript" src="${context}/js/svgNavigate.js"></script>
		<script type="text/javascript">
			var contextURL = "${context}";
			var currentTime = ${currentTime};
			var timezone = "${timezone}";
			var errorMessage = null;
			var successMessage = null;
			
			var projectId = ${project.id};
			var projectName = "${project.name}";
			var flowId = "${flowid}";
			var execId = null;
		</script>
		<link rel="stylesheet" type="text/css" href="${context}/css/azkaban-svg.css" />
		<link rel="stylesheet" type="text/css" href="${context}/css/jquery-ui-1.10.1.custom.css" />
	</head>
	<body>

#set ($current_page="all")
#parse ("azkaban/webapp/servlet/velocity/nav2.vm")

		<div class="container">

## Page error or success message.

#if ($errorMsg)
			<div class="panel panel-danger">
				<div class="panel-heading">Error</div>
				<div class="panel-body">
					$errorMsg
				</div>
			</div>
#else
	#if ($error_message != "null")
			<div class="alert alert-danger">$error_message</div>
	#elseif ($success_message != "null")
			<div class="alert alert-success">$success_message</div>
	#end

	## Alert message

			<div class="alert alert-dismissable alert-messaging" id="messaging">
				<button type="button" class="close" data-dismiss="alert" aria-hidden="true">&times;</button>
				<p id="messaging-message"></p>
			</div>
		</div>
	
	## Page header.

		<div class="az-page-header">
			<div class="container">
				<h1><a href="${context}/manager?project=${project.name}">Project <small>$project.name</small></a></h1>
				<p>$project.description</p>
			</div>
		</div>

	## Breadcrumbs and tabs

		<div class="container">
			<div class="row">
				<div class="col-lg-12">
					<ol class="breadcrumb">
						<li><a href="${context}/manager?project=${project.name}"><strong>Project</strong> $project.name</a></li>
						<li><a href="${context}/manager?project=${project.name}&flow=${flowid}"><strong>Flow</strong> $flowid</a></li>
					</ol>
				</div>
			</div>

			<div class="row">
				<div class="col-lg-8">
					<ul class="nav nav-pills" id="headertabs">
						<li id="graphViewLink"><a href="#graph">Graph</a></li>
						<li id="executionsViewLink"><a href="#executions">Executions</a></li>
						<li id="summaryViewLink"><a href="#summary">Summary</a></li>
					</ul>
				</div>
				<div class="col-lg-4">
					<div class="pull-right">
						<button type="button" class="btn btn-success" id="executebtn">Schedule / Execute Flow</button>
					</div>
					<div class="clearfix"></div>
				</div>
			</div>
					
	## Graph view.

	#parse ("azkaban/webapp/servlet/velocity/flowgraphview.vm")

	## Executions view.

			<div class="row" id="executionsView">
				<div class="col-lg-12">
					<table class="table table-striped table-bordered" id="execTable">
						<thead>
							<tr>
								<th>Execution Id</th>
								<th>User</th>
								<th class="date">Start Time</th>
								<th class="date">End Time</th>
								<th class="elapse">Elapsed</th>
								<th class="status">Status</th>
								<th class="action">Action</th>
							</tr>
						</thead>
						<tbody id="execTableBody">
						</tbody>
					</table>
					<ul id="pageSelection" class="pagination">
						<li id="previous" class="first"><a><span class="arrow">&larr;</span>Previous</a></li>
						<li id="page1"><a href="#page1">1</a></li>
						<li id="page2"><a href="#page2">2</a></li>
						<li id="page3"><a href="#page3">3</a></li>
						<li id="page4"><a href="#page4">4</a></li>
						<li id="page5"><a href="#page5">5</a></li>
						<li id="next"><a>Next<span class="arrow">&rarr;</span></a></li>
					</ul>
				</div>
			</div>
		
	## Summary view.

			<div class="row">
				<div class="col-lg-12" id="summaryView">
				</div>
			</div><!-- /#summaryView -->

			<div id="contextMenu">
			</div>

	#parse ("azkaban/webapp/servlet/velocity/invalidsessionmodal.vm")
	#parse ("azkaban/webapp/servlet/velocity/flowexecutionpanel.vm")
	#parse ("azkaban/webapp/servlet/velocity/messagedialog.vm")
#end

#parse("azkaban/webapp/servlet/velocity/footer.vm")
		</div><!-- /.container -->
	</body>
</body>
