{% load i18n %}
{% load mini_buildd_tags %}

<tr>
	{% for model in app.models %}
		{% if model.name == model_name %}
			<th scope="row" {% if model.perms.change %}class="overview">
				<a href="{{ model.admin_url }}">{{ model.name }}</a>{% else %}>{{ model.name }}{% endif %}
			</th>
			<td class="right">
				<!-- Support up to three wizards (repeated three times, found no good way yet to do this more nicely) -->
				{% if wiz0_function %}
					<a class="mbd-wizard"
						 href="/mini_buildd/api?command=meta&amp;model={{ model_path }}&amp;function={{ wiz0_function }}&amp;output=referer"
						 title="Wizard: {{ wiz0_title }}">
						{{ wiz0_name }}
					</a>
				{% endif %}

				{% if wiz1_function %}
					<a class="mbd-wizard"
						 href="/mini_buildd/api?command=meta&amp;model={{ model_path }}&amp;function={{ wiz1_function }}&amp;output=referer"
						 title="Wizard: {{ wiz1_title }}">
						{{ wiz1_name }}
					</a>
				{% endif %}

				{% if wiz2_function %}
					<a class="mbd-wizard"
						 href="/mini_buildd/api?command=meta&amp;model={{ model_path }}&amp;function={{ wiz2_function }}&amp;output=referer"
						 title="Wizard: {{ wiz2_title }}">
						{{ wiz2_name }}
					</a>
				{% endif %}

				&nbsp;&nbsp;
				{% if not hide_add and model.perms.add %}
					<a href="{{ model.admin_url }}add/" class="addlink mbd-addlink">{% trans 'Add' %}</a>
				{% endif %}
				{% if model.perms.change %}
					<a href="{{ model.admin_url }}" class="changelink mbd-changelink">{% trans 'Change' %}</a>
				{% endif %}

			</td>
			<td>
				{% mbd_model_count model_path %}
			</td>
		{% endif %}
	{% endfor %}
</tr>
