{% load i18n %}
{% load comments %}
{% load extra_filters %}
<td id="id_case_text_{{ forloop.counter }}" colspan="12">
	<table class="case_detail">
		<tr>
			<td valign="top" colspan='2'>
                            <h4>{% trans "Text" %}:</h4>
				<div class="content">{{ test_case.text|markdown2html }}</div>
			</td>
			<td valign="top" rowspan="2" width="200">
                            <h4><span class="title strong">{% trans "Attachment" %}:</span></h4>
				<ul class="ul-no-format">
					{% for attachment_file in attachments %}
					<li>
						<a href="{% url "mgmt-check_file" attachment_file.attachment_id %}">
							{{ attachment_file.file_name }}
						</a>
					</li>
					{% empty %}
                                        <li class="grey">{% trans "No attachment found" %}</li>
					{% endfor %}
				</ul>
                                <h4><span class="title strong">{% trans "Component" %}:</span></h4>
				<ul class="ul-no-format">
					{% for component in components %}
					<li id="display_component" >{{ component.name }}</li>
					{% empty %}
                                        <li class="grey">{% trans "No component found" %}</li>
					{% endfor %}
				</ul>
                                <h4><span class="title strong">{% trans "Tag" %}:</span></h4>
				<ul class="ul-no-format">
					{% for tag in tags %}
					<li>{{ tag }}</li>
					{% empty %}
                                        <li class="grey">{% trans "No tag found" %}</li>
					{% endfor %}
				</ul>
                                <h4><span class="title strong">{% trans "bug" %}:</span></h4>
				<ul class="ul-no-format">
					{% for bug in bugs %}
					<li>
						<a href="{{ bug.url }}">{{ bug.url }}</a>
                                                <span class="grey"> - {% trans "From Run" %}</span>
						<a href="{% url "testruns-get" bug.execution.run_id %}">{{ bug.execution.run_id }}</a>
					</li>
					{% empty %}
                                        <li class="grey">{% trans "No bug found" %}</li>
					{% endfor %}
				</ul>
			</td>
		</tr>
		<tr>
			<td colspan='3'>
                            <h4>{% trans "Notes" %}:</h4>
				<div class="content">{{ test_case.notes|urlize|linebreaksbr }}</div>
			</td>
		</tr>
		<tr>
			<td colspan="3" style="border:none; background:none">
                            <h4>{% trans "Comments" %}:</h4>
				{% for comment in case_comments %}
					<div id="comment{{ comment.pk }}">
						<div>
							<span class="strong">#{{ forloop.counter }}</span>
							<span class="strong">
								<a href="{% url "tcms-profile" comment.user.username %}">
									{{ comment.user.username }}
								</a>
							</span>
							<span class="grey">{{ comment.submit_date }}</span>
						</div>
						<div>
							{% if review_mode and comment.user.pk == user.pk %}
							<form action="#" method="post" class="form_comment">
								<input type="hidden" name="comment_id" value="{{ comment.pk }}" />
								<input class='commentdelete sprites' value='Delete Comment' type='submit' />
							</form>
							{% endif %}
						</div>
					{{ comment.comment|urlize|linebreaksbr }}
					</div>
				{% endfor %}
			</td>
		</tr>
                {% if review_mode and perms.django_comments.add_comment %}
		<tr>
			<td colspan="3" style='border:none;background:transparent'>
				<form class="update_form" method="POST">
                                    <textarea name="comment" cols="50" rows="4"></textarea>
				    <br/>
				    <input type="submit" value="{% trans 'Save' %}">
				</form>
			</td>
		</tr>
                {% endif %}
	</table>
</td>
