<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE xsl:stylesheet [
<!ENTITY amp   "&#38;">
<!ENTITY copy   "&#169;">
<!ENTITY gt   "&#62;">
<!ENTITY hellip "&#8230;">
<!ENTITY laquo  "&#171;">
<!ENTITY lsaquo   "&#8249;">
<!ENTITY lsquo   "&#8216;">
<!ENTITY lt   "&#60;">
<!ENTITY nbsp   "&#160;">
<!ENTITY quot   "&#34;">
<!ENTITY raquo  "&#187;">
<!ENTITY rsaquo   "&#8250;">
<!ENTITY rsquo   "&#8217;">
]>

<!--
OUTC19 Workshop XSL - 03/2019

COMMMON STYLESHEET 
Imported by all page type-specific stylesheets, and imports utility stylesheets.
Defines html, xsl templates and functions used globally throughout the implementation
Defines outer html structure and common include content.

Contributors: Cory Madden
-->
<xsl:stylesheet version="3.0" 
				xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
				xmlns:xs="http://www.w3.org/2001/XMLSchema"
				xmlns:ou="http://omniupdate.com/XSL/Variables"
				xmlns:fn="http://omniupdate.com/XSL/Functions"
				xmlns:ouc="http://omniupdate.com/XSL/Variables"
				exclude-result-prefixes="xsl xs ou fn ouc">

	<xsl:import href="_shared/template-matches.xsl"/>
	<xsl:import href="_shared/variables.xsl"/>
	<xsl:import href="_shared/functions.xsl"/>
	<xsl:import href="_shared/tag-functions.xsl" />

	<!-- Default: for HTML5 use below output declaration -->
	<xsl:output method="html" version="5.0" indent="yes" encoding="UTF-8" include-content-type="no"/>

	<xsl:template match="/document">
		<html lang="en" dir="ltr">
			<head>
				<meta charset="UTF-8" />
				<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" />
				<link rel="stylesheet" href="/workshop-tag-management/css/oustyles.css" />
				<xsl:apply-templates select="headcode/node()"/>
				<title><xsl:value-of select="$page-title"/></title>
				<!-- copy meta tags from pcf, but only those with content -->
				<xsl:apply-templates select="/document/ouc:properties[@label='metadata']/meta[string-length(@content) > 0]"/>
			</head>
			<body>
				<xsl:apply-templates select="bodycode/node()"/> <!-- from pcf -->
				<xsl:call-template name="common-header"/>
				<div class="container" id="main-content">
					<xsl:call-template name="page-content"/> <!-- each page type has a unique version of this template -->
				</div>
				<xsl:call-template name="common-footer"/>
				<script src="https://code.jquery.com/jquery-3.3.1.min.js"></script>
				<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
				<xsl:apply-templates select="footcode/node()"/> <!-- from pcf -->	
			</body>	
		</html>
	</xsl:template>

	<xsl:template name="page-content">
		<xsl:if test="normalize-space(ou:pcf-param('heading')) != ''">
			<h2><xsl:value-of select="ou:pcf-param('heading')" /></h2>
		</xsl:if>
		<xsl:apply-templates select="ouc:div[@label='instructions']" />
		<hr />
		<xsl:apply-templates select="ouc:div[@label='tag-notes']" />
		<hr />
		<h3>Reports</h3>
		<p>Here is the list of reports, you have generated.</p>
		<hr />
		<!-- get the tags -->
		
		
		<div class="panel-group" id="accordion" role="tablist" aria-multiselectable="true">
			
		</div>

	</xsl:template>

	
	<xsl:variable name="root" select="concat($ou:root, $ou:site)" />


	<!-- get all directories -->
	<xsl:template name="find-all-directories">
		<xsl:param name="dir" /> 
		<xsl:for-each select="doc($dir)/list/directory">
			<directory><xsl:value-of select="normalize-space(replace(concat($dir,'/',text()), $root, ''))" /></directory>
			<xsl:call-template name="find-all-directories">
				<xsl:with-param name="dir" select="concat($dir,'/',text())" />
			</xsl:call-template>
		</xsl:for-each>
	</xsl:template>

	<!-- header for the web page -->
	<xsl:template name="common-header">
		<header>
			<nav class="navbar">
				<div class="navbar-header">
					<h1><a class="navbar-brand" href="http://outc19.com/"><xsl:value-of select="$workshop-name" /></a></h1>
				</div>
			</nav>
		</header>
	</xsl:template>

	<!-- footer for the web page -->
	<xsl:template name="common-footer">
		<footer id="footer">
			<div class="container">
				<div class="row">
					<div class="col-md-12">
						<h2 class="text-center h4"><xsl:value-of select="$workshop-name" /></h2>
					</div>
				</div>
			</div>
		</footer>
		<div id="hidden" style="display:none;">
			<xsl:comment> com.omniupdate.ob </xsl:comment><xsl:comment> /com.omniupdate.ob </xsl:comment>
		</div>
	</xsl:template>
</xsl:stylesheet>
