<table id='issuelist' count='{{ test_case.get_issues.count }}' class="list" cellpadding="0" cellspacing="0" width="100%">
	<tr>
		<th class="widthID">Case Run ID</th>
		<th class="widthID">Run ID</th>
		<th>Issue URL</th>
        <th>Action</th>
	</tr>
	{% for issue in test_case.get_issues %}
	<tr class="{% cycle 'even' 'odd' %}">
		<td>{{ issue.case_run_id }}</td>
		<td>{% if issue.case_run_id %}<a href="{% url "run-get" issue.case_run.run_id %}">{{ issue.case_run.run_id }}</a>{% else %}None{% endif %}</td>
		<td><a href="{{ issue.get_absolute_url }}">{{ issue.get_absolute_url }}</a></td>
        <td>
			{% if perms.issuetracker.delete_issue %}
			<a href="javascript:void(0)" class="remove js-remove-issue"
				data-params='{"issueKey": "{{ issue.issue_key }}", "caseId": "{{ test_case.pk }}", "caseRunId": "{{ issue.case_run_id|default:'' }}"}'>Remove</a>
			{% else %}
			<label class="grey">None</label>
			{% endif %}
		</td>
	</tr>
	{% empty %}
	<tr>
		<td colspan="4" align="center" class="grey">No issues related to this case.</td>
	</tr>
	{% endfor %}
	{% if perms.issuetracker.add_issue and issue_trackers %}
	<tr>
		<td colspan="4" style="padding:0;">
			<form id="id_case_issue_form" action="{% url "cases-add-issue" test_case.case_id %}" method="post">
				<div class="addtag">
					<span class="tit">Add Issue</span>
					<select name='tracker' class="js-issue-tracker">
						{% for tracker in issue_trackers %}
						<option value="{{ tracker.pk }}" data-issue-key-regex="{{ tracker.validate_regex }}">{{ tracker.name }}</option>
						{% endfor %}
					</select>
					<input id="issue_key" class="js-issue-key" type="text" size="20" name="issue_key" />
					<input style="display:none">
					<a href="javascript:void(0)" class="addlink js-add-issue">Add</a>
				</div>
			</form>
		</td>
	</tr>
	{% endif %}
</table>
{% if message %}
	<div id="message" class="hidden">{{ message }}</div>
{% endif %}
