<form id="plans_form">
	<div id="contentTab" class="mixbar">
		{% 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" class="js-printable-plans" value="Printable copy" 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 />
	</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" class="js-select-all" type="checkbox" title="Select all/Select none" />
				</th>
				<th class="number nosort widthID" title="Sort by plan ID">ID</th>
				<th class="text nosort" title="Sort by plan name">Name</th>
				<th width="100" class="text nosort" title="Sort by author">Author</th>
				<th width="100" class="text nosort" title="Sort by owner">Owner</th>
				<th width="180" class="text nosort" title="Sort by product name">Product</th>
				<th width="140" class="text nosort" title="Sort by plan type">Type</th>
				<th width="50" class="number nosort" title="Sort by number of test cases">Cases</th>
				<th width="40" class="number nosort" title="Sort by number of test runs">Runs</th>
				<th class="nosort" width="80">Actions</th>
			</tr>
		</thead>
		<tbody>
			{% for plan in object_list %}
			<tr class="{% cycle 'odd' 'even' %}{% if not plan.is_active %} line-through inactive{% endif %}">
				<td><input type="checkbox" name="plan" value="{{ plan.pk }}" title="Select/Unselect"></td>
				<td class="{% if not plan.is_active %}underline{% endif %}"><a href="{{ plan.get_absolute_url }}">{{ plan.pk }}</a></td>
				<td class="{% if not plan.is_active %}underline{% endif %}"><a href="{{ plan.get_absolute_url }}" title="Go to {{ plan.name }}">{{ plan.name }} </a></td>
				<td><a href="{% url "user-profile" plan.author.username %}">{{ plan.author }}</a></td>
				<td>
					{% if plan.owner %}
					<a href="{% url "user-profile" plan.owner.username %}">{{ plan.owner }}</a>
					{% else %}
					No owner
					{% endif %}
				</td>
				<td>{{ plan.product }}</td>
				<td>{{ plan.type }}</td>
				<td>
					<a href="{{ plan.get_absolute_url }}" title="{{ plan.cases_count }} test cases">{{ plan.cases_count }}</a>
				</td>
				<td>
					<a href="{{ plan.get_absolute_url }}#testruns" title="{{ plan.runs_count }} test runs">{{ plan.runs_count }}</a>
				</td>
				<td>
					{% if perms.testplans.change_testplan %}
					<a class="editlink" href="{% url "plan-edit" plan.plan_id %}">Edit</a>
					{% endif %}
				</td>
			</tr>
			{% endfor %}
		</tbody>
	</table>
</form>
