!!! 5
html(lang="en")
	head
		title node-coverage Admin Interface
		link(rel="stylesheet", href="#{serverRoot}/style.css")
		link(href="http://fonts.googleapis.com/css?family=Inconsolata", rel="stylesheet", type="text/css")
	body
		h3.header node-coverage 
			em=name
			em=file
		.summary
			h2 Statement coverage: 
				h1 #{report.statements.percentage.toFixed(2)}%
		.summary
			h2 Condition coverage: 
				h1 #{report.conditions.percentage.toFixed(2)}%
		.summary
			h2 Function coverage: 
				h1 #{report.functions.percentage.toFixed(2)}%
		.legend
				dl
					dt #
					dd line number
					dt count
					dd how many times the statement was executed
					dt true
					dd conditions that were never evaluated <i>true</i>
					dt false
					dd conditions that were never evaluated <i>false</i>
		.clear

		.content
			table.small
				thead
					tr
						th #
						th count
						th true
						th false
						th
				tbody
					-var counter = 1
					each loc in report.code.src
						-var covered = loc.l ? (report.statements.detail[loc.l] > 0) : true
						-var coveredClass = covered ? "" : "not-covered"
						-var missing = {"true" : [], "false" : []}
						-if (covered && loc.c)
							-for (i=0; i<loc.c.length; i++)
								-if (report.conditions.detail.all[loc.c[i]]["true"] == 0)
									-var coveredClass = "partially-covered"
									-missing["true"].push(i + 1)
								-else if (report.conditions.detail.all[loc.c[i]]["false"] == 0)
									-var coveredClass = "partially-covered"
									-missing["false"].push(i + 1)
						tr(class=coveredClass)
							td=counter++
							td=loc.l ? report.statements.detail[loc.l] : ""
							td=missing ? missing["true"].join(", ") : ""
							td=missing ? missing["false"].join(", ") : ""
							td.code <code>#{loc.s}</code>