!!! 5
html(lang="en")
	head
		title node-coverage Admin Interface
		link(rel="stylesheet", href="#{serverRoot}/style.css")
	body
		h3.header node-coverage 
			em=name
		.summary
			h2 Statement coverage: 
				h1 #{report.global.statements.percentage.toFixed(2)}%
		.summary
			h2 Condition coverage: 
				h1 #{report.global.conditions.percentage.toFixed(2)}%
		.summary
			h2 Function coverage: 
				h1 #{report.global.functions.percentage.toFixed(2)}%
		.clear

		.content
			table
				thead
					tr.partial
						th
						th(colspan=3).flap 
							a(href="#{serverRoot}/stat/#{encodeURIComponent(name)}") Stats & Graphs
					tr
						-var isSorted = sort.what=="file"
						th(class=isSorted ? "sorted" : "")
							a(href="#{serverRoot}/r/#{encodeURIComponent(name)}/sort/file/"+(sort.how == "asc" || !isSorted ? "desc" : "asc")) File
							-if (isSorted)
								span.sort-direction=sort.how == "asc" ? "&uarr;" : "&darr;"
						
						-var isSorted = sort.what=="statement"
						th(class=isSorted ? "sorted" : "")
							a(href="#{serverRoot}/r/#{encodeURIComponent(name)}/sort/statement/"+(sort.how == "asc" || !isSorted ? "desc" : "asc")) Statement
							-if (isSorted)
								span.sort-direction=sort.how == "asc" ? "&uarr;" : "&darr;"
						
						-var isSorted = sort.what=="condition"
						th(class=isSorted ? "sorted" : "")
							a(href="#{serverRoot}/r/#{encodeURIComponent(name)}/sort/condition/"+(sort.how == "asc" || !isSorted ? "desc" : "asc")) Condition
							-if (isSorted)
								span.sort-direction=sort.how == "asc" ? "&uarr;" : "&darr;"
						
						-var isSorted = sort.what=="function"
						th(class=isSorted ? "sorted" : "")
							a(href="#{serverRoot}/r/#{encodeURIComponent(name)}/sort/function/"+(sort.how == "asc" || !isSorted ? "desc" : "asc")) Function
							-if (isSorted)
								span.sort-direction=sort.how == "asc" ? "&uarr;" : "&darr;"
				tbody
					each single in report.files
						tr
							td
								a(href="#{serverRoot}/r/#{encodeURIComponent(name)}/file/#{encodeURIComponent(single.file)}") #{single.file}
							
							-var percentage = single.report.statements.percentage
							if percentage < 30
								td.low #{percentage.toFixed(2)}%
							else if percentage > 80
								td.high #{percentage.toFixed(2)}%
							else
								td.notbad #{percentage.toFixed(2)}%
							
							-var percentage = single.report.conditions.percentage
							if percentage < 30
								td.low #{percentage.toFixed(2)}%
							else if percentage > 80
								td.high #{percentage.toFixed(2)}%
							else
								td.notbad #{percentage.toFixed(2)}%

							-var percentage = single.report.functions.percentage
							if percentage < 30
								td.low #{percentage.toFixed(2)}%
							else if percentage > 80
								td.high #{percentage.toFixed(2)}%
							else
								td.notbad #{percentage.toFixed(2)}%
