#*
 * 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 lang="en">
	<head>

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

		<script type="text/javascript" src="${context}/js/moment.min.js"></script>
		<script type="text/javascript" src="${context}/js/bootstrap-datetimepicker.min.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.layout.js"></script>
		<script type="text/javascript" src="${context}/js/azkaban.flow.view.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/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/bootstrap-datetimepicker.css" />
	</head>
	<body>

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

		<div class="container-full">
#parse ("azkaban/webapp/servlet/velocity/message.vm")
#if ($errorMsg)
  #parse ("azkaban/webapp/servlet/velocity/errormsg.vm")
#else
  #parse ("azkaban/webapp/servlet/velocity/alerts.vm")
		</div>
	
	## Page header.

		<div class="az-page-header">
			<div class="container-full">
				<div class="row">
					<div class="col-lg-6">
						<h1><a href="${context}/manager?project=${project.name}&flow=${flowid}">Flow <small>$flowid</small></a></h1>
					</div>
					<div class="col-lg-6">
						<div class="pull-right az-page-header-form">
							<button type="button" class="btn btn-sm btn-success" id="executebtn">Schedule / Execute Flow</button>
						</div>
						<div class="clearfix"></div>
					</div>
				</div>
			</div>
		</div>

	## Breadcrumbs and tabs

		<div class="container-full">
      <ol class="breadcrumb">
        <li><a href="${context}/manager?project=${project.name}"><strong>Project</strong> $project.name</a></li>
        <li class="active"><strong>Flow</strong> $flowid</li>
      </ol>

			<ul class="nav nav-tabs" 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>
					
	## Graph view.

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

	## Executions view.

    <div class="container-full" id="executionsView">
			<div class="row">
				<div class="col-lg-12">
					<table class="table table-striped table-bordered table-condensed table-hover" 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>
    </div><!-- /.container-fill -->

	## Summary view.

    <div class="container-full" id="summaryView">
			<div class="row" id="summary-view-content">
			</div><!-- /.row -->
    </div><!-- /.container-fill -->

    <div class="container-full">
			<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>
