{% extends "base.html" %}

{% load tags %}
{% load i18n %}

{% block title %}{% trans "Motions" %} – {{ block.super }}{% endblock %}

{% block content %}
    <h1>
        {% trans "Categories" %}
        <small class="pull-right">
        {% if perms.motion.can_manage_motion %}
            <a href="{% url 'motion_category_create' %}" class="btn btn-mini btn-primary" rel="tooltip" data-original-title="{% trans 'New category' %}"><i class="icon-plus icon-white"></i> {% trans 'New' %}</a>
        {% endif %}
        <a href="{% url 'motion_list' %}" class="btn btn-mini"><i class="icon-chevron-left"></i> {% trans "Back to overview" %}</a>
        </small>
    </h1>

   <table class="table table-striped table-bordered">
        <tr>
            <th class="mini_width">{% trans "Prefix" %}</th>
            <th>{% trans "Category name" %}</th>
            <th class="mini_width">{% trans "Actions" %}</th>
        </tr>
    {% for category in category_list %}
        <tr>
            <td>{{ category.prefix }}</td>
            <td><a href="{{ category|absolute_url }}">{{ category }}</a></td>
            <td><span style="width: 1px; white-space: nowrap;">
                <a href="{{ category|absolute_url:'update' }}" rel="tooltip" data-original-title="{% trans 'Edit' %}"
                    class="btn btn-mini"><i class="icon-pencil"></i>
                </a>
                <a href="{{ category|absolute_url:'delete' }}" rel="tooltip" data-original-title="{% trans 'Delete' %}"
                    class="btn btn-mini"><i class="icon-remove"></i>
                </a>
                </span>
            </td>
        </tr>
    {% empty %}
        <tr>
        <td colspan="3"><i>{% trans "No categories available." %}</i></td>
        </tr>
    {% endfor %}
    </table>
{% endblock %}
