{% extends "report/common/search_run.html" %}


{% block report %}
{% if report_data %}
	{% if queries %}
	<div class="queries">
		<ul>
		{% for k, v in queries.items %}
			<li><label>{{ k|title }}:</label>{{ v|safe }};</li>
		{% endfor %}
			<li class="clear"></li>
		</ul>
	</div>
	{% endif %}

	<div class="reportSummary01">
		<ul><li class="tagTab">Tester:<span>All Testers</span></li></ul>
		<ul>
			<li>
				Plan:<span>{{ report_data.plans_count }}</span>
				Run:<span>{{ report_data.runs_count }}</span>
				Case-Run:<span>{{ report_data.caseruns_count }}</span>
			</li>
		</ul>
		<div class="clear"></div>
	</div>

	<table width="100%" border="0" cellpadding="0" cellspacing="0" class="listTdReport">
		<tr>
			<th class="w350">Build</th>
			<th class="w90">Priority </th>
			<th class="w50">Idle</th>
			<th class="w50">Running</th>
			<th class="w50">Paused</th>
			<th class="w50">Passed</th>
			<th class="w50">Failed</th>
			<th class="w50">Blocked</th>
			<th class="w50">Error</th>
			<th class="w50">Waived</th>
			<th>Total</th>
		</tr>
		{% for build, priority, status_subtotal in report_data.reports %}
		<tr>
			{% if build.2 is not None %}
			<td rowspan="{{ build.2 }}" class="bgRowspan"><span>{{ build.1 }}</span></td>
			{% endif %}
			<td><span>{{ priority.value }}</span></td>
			<td><a href="{{ report_url }}{{path_without_build}}&r_build={{build.0}}&priority={{priority.pk}}&status=idle">{{ status_subtotal.IDLE|default:0 }}</a></td>
			<td><a href="{{ report_url }}{{path_without_build}}&r_build={{build.0}}&priority={{priority.pk}}&status=running">{{ status_subtotal.RUNNING|default:0 }}</a></td>
			<td><a href="{{ report_url }}{{path_without_build}}&r_build={{build.0}}&priority={{priority.pk}}&status=paused">{{ status_subtotal.PAUSED|default:0 }}</a></td>
			<td><a href="{{ report_url }}{{path_without_build}}&r_build={{build.0}}&priority={{priority.pk}}&status=passed">{{ status_subtotal.PASSED|default:0 }}</a></td>
			<td><a href="{{ report_url }}{{path_without_build}}&r_build={{build.0}}&priority={{priority.pk}}&status=failed">{{ status_subtotal.FAILED|default:0 }}</a></td>
			<td><a href="{{ report_url }}{{path_without_build}}&r_build={{build.0}}&priority={{priority.pk}}&status=blocked">{{ status_subtotal.BLOCKED|default:0 }}</a></td>
			<td><a href="{{ report_url }}{{path_without_build}}&r_build={{build.0}}&priority={{priority.pk}}&status=error">{{ status_subtotal.ERROR|default:0 }}</a></td>
			<td><a href="{{ report_url }}{{path_without_build}}&r_build={{build.0}}&priority={{priority.pk}}&status=waived">{{ status_subtotal.WAIVED|default:0 }}</a></td>
			<td><a href="{{ report_url }}{{path_without_build}}&r_build={{build.0}}&priority={{priority.pk}}">{{ status_subtotal.total }}</a></td>
		</tr>
		{% empty %}
			<tr><td colspan="11" align="center">No report data.</td></tr>
		{% endfor %}
	</table>
{% endif %}
{% endblock %}
