{% extends "base.html" %}
{% load i18n %}
{% load staticfiles %}

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

{% block content %}
    <h1>{% trans "Tags" %}
        <small class="pull-right">
            <a href="javascript:window.history.back()" class="btn btn-mini">
                <i class="icon-chevron-left"></i><span class="optional-small"> {% trans "Back to overview" %}</span>
            </a>
        </small>
    </h1>

    <div class="control-group">
        <label for="tag-edit">{% trans 'Enter new tag name' %}:</label>
        <input id="tag-edit" name="new">
        <a href="#" id="tag-save" class="btn btn-primary">{% trans 'Save' %}</a>
    </div>

    <table id="tag-table" class="table table-striped table-bordered">
        <tr>
            <th>{% trans "Tag" %}</th>
            <th class="mini_width">{% trans "Actions" %}</th>
        </tr>
        <tr id="dummy-tag" class="tag-row" style="display:none">
            <td class="tag-name"></td>
            <td>
                <span style="width: 1px; white-space: nowrap;">
                    <a href="#" rel="tooltip" data-original-title="{% trans 'Edit' %}" class="btn btn-mini tag-edit">
                        <i class="icon-pencil "></i>
                    </a>
                    <a href="#" rel="tooltip" data-original-title="{% trans 'Delete' %}" class="btn btn-mini tag-del">
                        <i class="icon-remove"></i>
                    </a>
                </span>
            </td>
        </tr>
        {% for tag in tag_list %}
            <tr id="tag-{{ tag.pk }}" class="tag-row">
                <td class="tag-name">{{ tag }}</td>
                <td>
                    <span style="width: 1px; white-space: nowrap;">
                        <a href="#" rel="tooltip" data-original-title="{% trans 'Edit' %}" class="btn btn-mini tag-edit">
                            <i class="icon-pencil "></i>
                        </a>
                        <a href="#" rel="tooltip" data-original-title="{% trans 'Delete' %}" class="btn btn-mini tag-del">
                            <i class="icon-remove"></i>
                        </a>
                    </span>
                </td>
            </tr>
        {% endfor %}
    </table>
    <p>{% trans "You can use these tags for agenda items, motions and elections." %}</p>
{% endblock %}

{% block javascript %}
    <script src="{% static 'js/config_tags.js' %}" type="text/javascript"></script>
{% endblock %}
