{% 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">
				{% if report_data.tags_names %}
				Tag: {% for tag_name in report_data.tags_names %}{{ tag_name }},&nbsp;{% endfor %}
				{% else %}
				No tags have data for this report. Please refer to detail report
				{% endif %}
				<a href="{% url "testing-report" %}{{ request_path }}&report_type=per_plan_tag_report"
					style="font-weight:normal; text-decoration:underline;">Per Tag View</a>
			</li>
		</ul>
		<ul><li>Plan:<span>{{ report_data.plans_count }}</span>Run:<span>{{ report_data.runs_count }}</span></li></ul>
		<div class="clear"></div>
	</div>

	<table width="100%" border="0" cellpadding="0" cellspacing="0" class="listTdReport">
		<tr>
			<th class="w350">Tag</th>
			<th class="w50">plan</th>
			<th class="w50">Run</th>
			<th class="w90">Run Passed</th>
			<th>Run Failed</th>
		</tr>
		{% for tag_name, plans_count, runs_count, status_subtotal in report_data.reports %}
		<tr>
			<td><span>{{ tag_name }}</span></td>
			<td>{{ plans_count }}</td>
			<td>{{ runs_count }}</td>
			<td>{{ status_subtotal.PASSED|default:0 }}</td>
			<td>{{ status_subtotal.FAILED|default:0 }}</td>
		</tr>
		{% empty %}
		<tr>
			<td colspan="5" align="center">No report data.</td>
		</tr>
		{% endfor %}
	</table>
{% endif %}
{% endblock %}
