<?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;">
]>

<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 fn">
	
	<xsl:import href="_shared/functions.xsl"/>
	<xsl:import href="_shared/variables.xsl"/>
	<xsl:import href="_shared/template-matches.xsl"/>
	
	<xsl:output method="html" version="5.0" encoding="UTF-8" />
	
	<xsl:template match="/document">
		
		<html lang="en">
			
			<head>
				<meta charset="UTF-8"/>
				<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
				<title></title>
				<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>
				<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap.min.css" rel="stylesheet" />
				<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/js/bootstrap.min.js"></script>
				<style>
					body { background-color: ghostwhite; }
					.centered { margin: 0 auto; float: none; }
					.section { background-color: #337AB7; padding: 10px; color: white;  /*border-bottom: 3px solid #ddd; margin-top: 40px; border-top: 0px solid #bbb;*/ }
					h2 > small { color: #d0e2f2; }
					h1 > small {  }
					small > span { font-weight: bold; }
					img { max-width: 100%; }
				</style>			
			</head>
			<body>
				<div class="container-fluid">
					<h1>
						Testing Doc<br/>
						<small>
							account: <span id="account-name"><xsl:value-of select="ouc:properties[@label='config']/parameter[@name='account']" /></span>,
							site: <span id="site-name"><xsl:value-of select="ouc:properties[@label='config']/parameter[@name='site']" /></span>
						</small>
					</h1>
					<div class="row">
						<!-- this row contains values from page properties and doesn't interact with the testing-doc.js script-->
						<div class="col-md-2">
							<h2 class="section">Users</h2>
							<div>
								<blockquote>				
									<p>
										Level 10 User<br/>
										username: <xsl:value-of select="ouc:properties[@label='users']/parameter[@name='level10-name']" /><br/>
										password: <xsl:value-of select="ouc:properties[@label='users']/parameter[@name='level10-pass']" />
									</p>	
								</blockquote>
								<blockquote>
									<p>
										Level 6 User<br/>
										username: <xsl:value-of select="ouc:properties[@label='users']/parameter[@name='level6-name']" /><br/>
										password: <xsl:value-of select="ouc:properties[@label='users']/parameter[@name='level6-pass']" />
										<small>Note: Please use another browser to test level 6 user. The testing doc does not currently work for levels 9 and below.</small>
									</p>
								</blockquote>
							</div>
						</div>	
						<div class="col-md-10">
							<h2 class="section">Project Notes</h2>
							<div class="panel-group" id="pcf-accordion">
								<xsl:for-each select="ouc:properties[@label='notes']/parameter">
									<div class="panel-default panel">
										<div class="panel-heading">
											<h4 class="panel-title">
												<a data-toggle="collapse" class="collapsed" data-parent="#pcf-accordion" href="#collapse{position()}">
													<xsl:value-of select="@prompt" />
												</a>						
											</h4>
										</div>
										<div class="panel-collapse collapse" id="collapse{position()}">
											<div class="panel-body">
												<xsl:value-of select="." />
											</div>
										</div>
									</div>
								</xsl:for-each>
							</div>	
						</div>
					</div>
					
					<div class="row">
						<!-- populated by testing-doc.js -->	
						<div class="col-md-12">
							<h2 class="section">Templates <small>(automatically generated)</small></h2>
							<div id="templates-accordion" class="col-md-12 panel-group">
								<!-- container for template data -->
							</div>
							<xsl:if test="string-length(ouc:properties[@label='custom']/parameter[@name='exclusions']) &gt; 1">
								<h4>exclusions: <span id="exclusions"><xsl:value-of select="ouc:properties[@label='custom']/parameter[@name='exclusions']" /></span></h4>
							</xsl:if>
						</div>
					</div>
					
					<div class="row">
						<!-- populated by testing-doc.js -->
						<div class="col-md-6">
							<div class="panel panel-default">
								<div class="panel-body">
									<h2 class="section">Directory Variables at Site Level <small>(automatically generated)</small></h2>
									<table class="table-striped table">
										<thead><tr><th>Name</th><th>Default Value</th></tr></thead>
										<tbody id="site-vars"></tbody>
									</table>
									<div class="row">
										<div class="col-md-6">
											<xsl:apply-templates select="ouc:div[@label='var-results']"/>
										</div>
										<div class="col-md-6">
											<xsl:apply-templates select="ouc:div[@label='var-comments']"/>
										</div>
									</div>
								</div>
							</div>
						</div>
						
						<div class="col-md-6">
							<!-- populated by testing-doc.js -->	
							<div class="panel panel-default">
								<div class="panel-body">
									<h2 class="section">Snippets by Category <small>(automatically generated)</small></h2>
									<div id="snippet-container">
										<!-- necessary because # of snippet categories is undefined -->
									</div>
									<div class="row">
										<div class="col-md-6">
											<xsl:apply-templates select="ouc:div[@label='snippet-results']"/>
										</div>
										<div class="col-md-6">
											<xsl:apply-templates select="ouc:div[@label='snippet-comments']"/>
										</div>
									</div>
								</div>		
							</div>
						</div>
					</div>
					
					<div class="row">
						<!-- populated by testing-doc.js -->	
						<div class="col-md-12">
							<div class="panel panel-default">
								<div class="panel-body">
									<h2 class="section">Assets <small>(automatically generated)</small></h2>
									<table class="table table-striped">
										<thead><tr><th>Name</th><th>Type</th><th>DM Tag</th><th>Tags</th><th>Site</th><th>Locked to Site</th><th>Access Restrictions</th><th>Description</th></tr></thead>
										<tbody id="site-assets"></tbody>
									</table>
									<div class="row">
										<div class="col-md-6">
											<xsl:apply-templates select="ouc:div[@label='asset-results']"/>
										</div>
										<div class="col-md-6">
											<xsl:apply-templates select="ouc:div[@label='asset-comments']"/>
										</div>
									</div>
								</div>
							</div>	
						</div>
					</div>
					
					<div class="row">
						<div class="col-md-4">
							<div class="panel panel-default">
								<div class="panel-body">
									<h2 class="section">Analytics</h2>
									<table class="table table-striped">
										<thead>
											<tr><th>Testing Steps</th></tr>
										</thead>
										<tbody>
											<tr>
												<td>Verify that <em>analytics.inc</em> exists (usually in '/_resources/includes' directory) or code is directly included in xsl. </td>
											</tr>
											<tr>
												<td>Verify that <em>analytics.inc</em> is properly included in templates (usually in <em>common.xsl</em>)</td>
											</tr>
											<tr>
												<td>Verify that <em>analytics.inc</em> include is commented out in <em>common.xsl</em> until go live date</td>
											</tr>
										</tbody>
									</table>
									<div class="row">
										<div class="col-md-6">
											<xsl:apply-templates select="ouc:div[@label='analytics-results']"/>
										</div>
										<div class="col-md-6">
											<xsl:apply-templates select="ouc:div[@label='analytics-comments']"/>
										</div>
									</div>
								</div>
							</div>
						</div>
						
						<div class="col-md-4">
							<div class="panel panel-default">
								<div class="panel-body">
									<h2 class="section">Navigation</h2>
									<table class="table table-striped">
										<caption>
											Note: Look for the following navigation types and see if supporting files exist (list them). Then test each navigation type by building out a multi-level directory and reviewing the published result.
											<ul>
												<li>Current[local] only navigation functions properly(at root for parent/current, without subdirectory for current/child)</li>
												<li>Single level nesting is functioning properly</li>
												<li>Multi-level nesting is functioning properly (if applicable)</li>
												<li>Breadcrumb Navigation is working properly</li>
												<li>Top Navigation is appearing and working correctly</li>
											</ul>
										</caption>
										<thead>
											<tr><th>Navigation Type</th></tr>
										</thead>
										<tbody>
											<tr>
												<td>Side Navigation (<em>_sidenav.inc</em> and script if applicable)</td>
											</tr>
											<tr>
												<td>Top Navigation</td>
											</tr>
											<tr>
												<td>Breadcrumb Navigation</td>
											</tr>
											<tr>
												<td>Local Section Navigation (Secondary Navigation)</td>
											</tr>
										</tbody>
									</table>
									<div class="row">
										<div class="col-md-6">
											<xsl:apply-templates select="ouc:div[@label='nav-results']"/>
										</div>
										<div class="col-md-6">
											<xsl:apply-templates select="ouc:div[@label='nav-comments']"/>
										</div>
									</div>	
								</div>
							</div>
						</div>
						
						<div class="col-md-4">
							<div class="panel panel-default">
								<div class="panel-body">
									<h2 class="section">Final Tasks</h2>
									<table class="table table-striped">
										<thead>
											<tr><th>Testing Steps</th></tr>
										</thead>
										<tbody>
											<tr><td>Verify Search, WNL, RSS, and LDP are working per dev notes</td></tr>
											<tr><td>Verify that DM is turned on and the site has been scanned</td></tr>
											<tr><td>Verify that <em>_sidenav.inc</em> and other resource files are excluded from sitemap</td></tr>
											<tr><td>Verify that <em>robots.txt</em> excludes <em>_resources</em>, <em>_training</em>, and <em>_zztes</em>t and <em>_demo</em> from indexing</td></tr>
											<tr><td>Delete all test assets and sections</td></tr>
											<tr><td>Write additional comments in the section below</td></tr>
										</tbody>
									</table>
									<div class="row">
										<div class="col-md-6">
											<xsl:apply-templates select="ouc:div[@label='final-results']"/>	
										</div>
										<div class="col-md-6">
											<xsl:apply-templates select="ouc:div[@label='final-comments']" />	
										</div>
									</div>
								</div>
							</div>
						</div>
					</div>
					
					<!-- the classes seen in the following DIVs are used by testing-doc.js to hide/show and re-position -->
					<div class="testing-comments-0 col-md-6"><xsl:apply-templates select="ouc:div[@label='template-results-0']"/></div>
					<div class="testing-comments-1 col-md-6"><xsl:apply-templates select="ouc:div[@label='template-results-1']"/></div>
					<div class="testing-comments-2 col-md-6"><xsl:apply-templates select="ouc:div[@label='template-results-2']"/></div>
					<div class="testing-comments-3 col-md-6"><xsl:apply-templates select="ouc:div[@label='template-results-3']"/></div>
					<div class="testing-comments-4 col-md-6"><xsl:apply-templates select="ouc:div[@label='template-results-4']"/></div>
					<div class="testing-comments-5 col-md-6"><xsl:apply-templates select="ouc:div[@label='template-results-5']"/></div>
					<div class="testing-comments-6 col-md-6"><xsl:apply-templates select="ouc:div[@label='template-results-6']"/></div>
					<div class="testing-comments-7 col-md-6"><xsl:apply-templates select="ouc:div[@label='template-results-7']"/></div>
					<div class="testing-comments-8 col-md-6"><xsl:apply-templates select="ouc:div[@label='template-results-8']"/></div>
					<div class="testing-comments-9 col-md-6"><xsl:apply-templates select="ouc:div[@label='template-results-9']"/></div>
					<div class="testing-comments-10 col-md-6"><xsl:apply-templates select="ouc:div[@label='template-results-10']"/></div>
					<div class="testing-comments-11 col-md-6"><xsl:apply-templates select="ouc:div[@label='template-results-11']"/></div>
					<div class="testing-comments-12 col-md-6"><xsl:apply-templates select="ouc:div[@label='template-results-12']"/></div>
					<div class="testing-comments-13 col-md-6"><xsl:apply-templates select="ouc:div[@label='template-results-13']"/></div>
					<div class="testing-comments-14 col-md-6"><xsl:apply-templates select="ouc:div[@label='template-results-14']"/></div>
					<div class="testing-comments-15 col-md-6"><xsl:apply-templates select="ouc:div[@label='template-results-15']"/></div>
					<div class="testing-comments-16 col-md-6"><xsl:apply-templates select="ouc:div[@label='template-results-16']"/></div>
					<div class="testing-comments-17 col-md-6"><xsl:apply-templates select="ouc:div[@label='template-results-17']"/></div>
					<div class="testing-comments-18 col-md-6"><xsl:apply-templates select="ouc:div[@label='template-results-18']"/></div>
					<div class="testing-comments-19 col-md-6"><xsl:apply-templates select="ouc:div[@label='template-results-19']"/></div>
					<div class="testing-comments-20 col-md-6"><xsl:apply-templates select="ouc:div[@label='template-results-20']"/></div>
					<div class="testing-comments-21 col-md-6"><xsl:apply-templates select="ouc:div[@label='template-results-21']"/></div>
					<div class="testing-comments-22 col-md-6"><xsl:apply-templates select="ouc:div[@label='template-results-22']"/></div>
					<div class="testing-comments-23 col-md-6"><xsl:apply-templates select="ouc:div[@label='template-results-23']"/></div>
					<div class="testing-comments-24 col-md-6"><xsl:apply-templates select="ouc:div[@label='template-results-24']"/></div>
	

					<div class="testing-comments-0 col-md-6"><xsl:apply-templates select="ouc:div[@label='template-comments-0']"/></div>				
					<div class="testing-comments-1 col-md-6"><xsl:apply-templates select="ouc:div[@label='template-comments-1']"/></div>
					<div class="testing-comments-2 col-md-6"><xsl:apply-templates select="ouc:div[@label='template-comments-2']"/></div>
					<div class="testing-comments-3 col-md-6"><xsl:apply-templates select="ouc:div[@label='template-comments-3']"/></div>
					<div class="testing-comments-4 col-md-6"><xsl:apply-templates select="ouc:div[@label='template-comments-4']"/></div>
					<div class="testing-comments-5 col-md-6"><xsl:apply-templates select="ouc:div[@label='template-comments-5']"/></div>
					<div class="testing-comments-6 col-md-6"><xsl:apply-templates select="ouc:div[@label='template-comments-6']"/></div>
					<div class="testing-comments-7 col-md-6"><xsl:apply-templates select="ouc:div[@label='template-comments-7']"/></div>
					<div class="testing-comments-8 col-md-6"><xsl:apply-templates select="ouc:div[@label='template-comments-8']"/></div>
					<div class="testing-comments-9 col-md-6"><xsl:apply-templates select="ouc:div[@label='template-comments-9']"/></div>
					<div class="testing-comments-10 col-md-6"><xsl:apply-templates select="ouc:div[@label='template-comments-10']"/></div>
					<div class="testing-comments-11 col-md-6"><xsl:apply-templates select="ouc:div[@label='template-comments-11']"/></div>
					<div class="testing-comments-12 col-md-6"><xsl:apply-templates select="ouc:div[@label='template-comments-12']"/></div>
					<div class="testing-comments-13 col-md-6"><xsl:apply-templates select="ouc:div[@label='template-comments-13']"/></div>
					<div class="testing-comments-14 col-md-6"><xsl:apply-templates select="ouc:div[@label='template-comments-14']"/></div>
					<div class="testing-comments-15 col-md-6"><xsl:apply-templates select="ouc:div[@label='template-comments-15']"/></div>
					<div class="testing-comments-16 col-md-6"><xsl:apply-templates select="ouc:div[@label='template-comments-16']"/></div>
					<div class="testing-comments-17 col-md-6"><xsl:apply-templates select="ouc:div[@label='template-comments-17']"/></div>
					<div class="testing-comments-18 col-md-6"><xsl:apply-templates select="ouc:div[@label='template-comments-18']"/></div>
					<div class="testing-comments-19 col-md-6"><xsl:apply-templates select="ouc:div[@label='template-comments-19']"/></div>
					<div class="testing-comments-20 col-md-6"><xsl:apply-templates select="ouc:div[@label='template-comments-20']"/></div>
					<div class="testing-comments-21 col-md-6"><xsl:apply-templates select="ouc:div[@label='template-comments-21']"/></div>
					<div class="testing-comments-22 col-md-6"><xsl:apply-templates select="ouc:div[@label='template-comments-22']"/></div>
					<div class="testing-comments-23 col-md-6"><xsl:apply-templates select="ouc:div[@label='template-comments-23']"/></div>
					<div class="testing-comments-24 col-md-6"><xsl:apply-templates select="ouc:div[@label='template-comments-24']"/></div>

					
					
					<p><a href="#" class="btn btn-lg btn-primary" id="imgGen">Create Image</a></p>
					<p>(All tabs will be expanded and a screenshot will be generated beneath this text. May take several seconds to render.)</p>
					<p><img src="" id="screenshot" width="200" height="200" class="hidden" /></p>
				</div>	
				<script src="/_resources/js/testing-doc.js"></script>
				<script src="https://cdnjs.cloudflare.com/ajax/libs/html2canvas/0.4.1/html2canvas.js"></script>
				<script>
					$('#imgGen').click(function(){
						$('.collapse').addClass('in');
						html2canvas(document.body, {
						  onrendered: function(canvas) {
							$('#screenshot').attr("src",canvas.toDataURL("image/png"));
							$('.collapse').removeClass('in');
							$('#screenshot').removeClass('hidden');
							window.scrollTo(0,document.body.scrollHeight);
						  }
						});
						return false;
					})
				</script>
			</body>
		</html>		
	</xsl:template>
</xsl:stylesheet>
