{% load static %}
<table class="list" id="id_table_cases" cellspacing="0" cellspan="0">
	<thead>
		<tr>
			<th width="20">
				<input id="id_check_all_button" type="checkbox" class="js-select-all" title="Select all cases/Select none case" />
			</th>
			<th width="18">
				<a id="id_blind_all_link" title="Expand all cases">
					<img id="id_blind_all_img" src="{% static "images/t1.gif" %}" border="0" alt="" class="collapse-all">
				</a>
			</th>
			<th class="widthID">Case Run ID</th>
			<th class="widthID">Case ID</th>
			<th>Summary</th>
			<th width="80">Tester</th>
			<th width="80">Assignee</th>
			<th width="140">Automated </th>
			<th width="100">Category</th>
			<th width="50">Priority</th>
			<th width="40">Issues</th>
			<th width="50" style='text-align:center'>Status</th>
			<th width="65">Comments</th>
			<th width="40">Sort</th>
		</tr>
	</thead>
	<tbody>
		{% for test_case_run, tester, assignee, priority_value, status_name, comments_count, issues_count in test_case_runs %}
		<tr class="{% cycle 'odd' 'even' %} {% if test_case_run.assignee_id == user.pk %}mine{% endif %}">
			<td class="selector_cell">
				<input type="checkbox" name="case_run" value="{{ test_case_run.pk }}" title="Select/Unselect" />
				<input type="hidden" name="case" value="{{ test_case_run.case.pk }}" />
				<input type="hidden" name="case_text_version" value="{{ test_case_run.case_text_version }}" />
			</td>
			<td title="expand test case" class="expandable vmiddle case_title">
				<img class="blind_icon expand" src="{% static "images/t1.gif" %}" border="0" alt="" />
			</td>
			<td class="case_title expandable">
				<a href="#caserun_{{ test_case_run.pk }}">#{{ test_case_run.pk }}</a>
			</td>
			<td class="case_title expandable">
				<a href="{% url "case-get" test_case_run.case_id %}?from_plan={{ test_case_run.run.plan_id }}">{{ test_case_run.case_id }}</a>
			</td>
			<td class="expandable">
				<a id="link_{{ forloop.counter }}" href="#caserun_{{ test_case_run.pk }}" title="Expand test case">{{ test_case_run.case.summary }}</a>
			</td>
			<td>
				{% if tester %}
				<a href="{% url "user-profile" tester %}" class="link_tested_by">{{ tester }}</a>
				{% else %}
				<a class="link_tested_by">None</a>
				{% endif %}
			</td>
			<td>
				{% if assignee %}
				<a href="{% url "user-profile" assignee %}" class="link_assignee">{{ assignee }}</a>
				{% else %}None{% endif %}
			</td>
			<td class="expandable">{{ test_case_run.case.get_is_automated_status }}</td>
			<td class="expandable">{{ test_case_run.case.category }}</td>
			<td class="expandable">{{ priority_value }}</td>
			<td class="expandable"><span id="{{ test_case_run.pk }}_case_issues_count" {% if issues_count %}class="have_issue"{% endif %}>{{ issues_count }}</span></td>
			<td class="expandable center">
				<img border="0" alt="" class="icon_status btn_{{ status_name|lower }}" />
			</td>
			<td>
				<div id="{{ test_case_run.case_id }}_case_comment_count">
					{% if comments_count %}<img src="{% static "images/comment.png" %}" style="vertical-align: middle;">{% endif %}
					<span id="{{ test_case_run.case_id }}_comments_count">{{ comments_count }}</span>
				</div>
			</td>
			<td class="expandable">
				<span class="mark">
					<a href="#" class="js-change-order" data-params='["{{ test_case_run.run_id }}", "{{ test_case_run.pk }}", "{{ test_case_run.sortkey }}"]'>{{ test_case_run.sortkey }}</a>
				</span>
			</td>
		</tr>
		<tr class="case_content hide js-details-caserun" style="display: none;">
			<td id="id_loading_{{ test_case_run.case_id }}" class="left_panel" colspan="14">
				<div class="ajax_loading"></div>
			</td>
		</tr>
		{% empty %}
		<tr>
			<td colspan="13" align="center">No case run found</td>
		</tr>
		{% endfor %}
	</tbody>
</table>
