<form id="plans_form">
	<div id="contentTab" class="mixbar">
		{#<span class="tit">{{ this_page.object_list|length }} Plans</span>#}
		<span>
			{% if perms.testplans.add_testplan %}
			<input type="button" title="Create new test plan" value="New Test Plan" class="js-new-plan" data-param="{% url "plans-new" %}" />
			<input type="button" value="Clone" title="clone selected test plans." class="js-clone-plans" data-param="{% url "plans-clone" %}" disabled />
			{% endif %}
			<input type="button" value="Printable copy" id="plan_advance_printable" class="js-printable-plans" disabled
				title="Create the printable copy for selected plans." data-param="{% url "plans-printable" %}" />
			<input type="button" value="Export" title="Export the cases for selected plans." class="js-export-plans"
				data-param="{% url "plans-export" %}" disabled />
		</span>
	</div>
	<table id="testplans_table" class="list border-bottom" cellpadding="0" cellspacing="0" border="0" style="table-layout:fixed;">
		<thead>
			<tr>
				<th width="20" class="nosort">
					<input id="id_check_all_plans" type="checkbox" class="js-select-all" title="Select all/Select none" />
				</th>
				<th class="number nosort widthID" title="Sort by plan ID"><a href="{{query_url}}&order_by=plan_id">ID</a></th>
				<th class="text nosort" title="Sort by plan name"><a href="{{query_url}}&order_by=name">Name</a></th>
				<th width="100" class="text nosort" title="Sort by author"><a href="{{query_url}}&order_by=author__username">Author</a></th>
				<th width="100" class="text nosort" title="Sort by owner"><a href="{{query_url}}&order_by=owner__username">Owner</th>
				<th width="180" class="text nosort" title="Sort by product name" id="col_product_head"><a href="{{query_url}}&order_by=product__name">Product</a></th>
				<th width="120" class="nosort" title="Sort by product version" style="display:none" id="col_product_version_head"><span></span>Product Version</th>
				<th width="140" class="text nosort" title="Sort by plan type"><a href="{{query_url}}&order_by=type">Type</a></th>
				<th width="50" class="number nosort" title="Sort by number of test cases"><a href="{{query_url}}&order_by=num_cases">Cases</a></th>
				<th width="40" class="number nosort" title="Sort by number of test runs"><a href="{{query_url}}&order_by=num_runs">Runs</a></th>
				<th class="nosort" width="80"><span></span>Actions</th>
			</tr>
		</thead>
		<tbody>
			{% for test_plan in this_page %}
			<tr class="{% if not test_plan.is_active %}line-through inactive{% endif %}">
				<td><input type="checkbox" name="plan" value="{{ test_plan.pk }}" title="Select/Unselect"></td>
				<td class="{% if not test_plan.is_active %}underline{% endif %}"><a href="{{ test_plan.get_absolute_url }}">{{ test_plan.plan_id }}</a></td>
				<td class="{% if not test_plan.is_active %}underline{% endif %}"><a href="{{ test_plan.get_absolute_url }}" title="Go to {{ test_plan.name }}">{{ test_plan }} </a></td>
				<td><a href="{% url "user-profile" test_plan.author.username %}">{{ test_plan.author }}</a></td>
				<td>
					{% if test_plan.owner %}
					<a href="{% url "user-profile" test_plan.owner.username %}">{{ test_plan.owner }}</a>
					{% else %}
					No owner
					{% endif %}
				</td>
				<td class="col_product_content">{{ test_plan.product }}</td>
				<td style="display:none" class="col_product_version_content">{{ test_plan.product_version }}</td>
				<td>{{ test_plan.type }}</td>
				<td><a href="{{ test_plan.get_absolute_url }}" title="{{ test_plan.num_cases }} test cases">{{ test_plan.num_cases }}</a></td>
				<td><a href="{{ test_plan.get_absolute_url }}#testruns" title="{{ test_plan.num_runs }} test runs">{{ test_plan.num_runs }}</a></td>
				<td>
					{% if perms.testplans.change_testplan %}
					<a class="editlink" href="{% url "plan-edit" test_plan.plan_id %}">Edit</a>
					{% endif %}
				</td>
			</tr>
			{% empty %}
			<tr>
				<td colspan="9"><center>No test plans found.</center></td>
			</tr>
			{% endfor %}
		</tbody>
	</table>
</form>
{% include "search/navigator.html" %}
