{% extends 'console/sortable_table.html' %}

{% block content %}

    <div>
        <form id="tags-form" class="form-inline" role="form" action="{% url 'console_tags' %}" method="post">
            {% csrf_token %}
            {{ tagform }}
            <button type="submit" class="btn btn-primary">Add</button>
        </form>
    </div>
    <br>
    <div class="table-responsive tablesorter">
        <table class="table table-hover table-bordered">
            <thead>
                <tr>
                    <th>ID</th>
                    <th>Name</th>
                    <th></th>
                </tr>
            </thead>
            <tbody>
            {% for t in tags %}
                <tr>
                    <td>{{ t.id }}</td>
                    <td><a href="{% url 'console_tag' t.name %}">{{ t.name }}</a></td>
                    <td>
                        <a href="{% url 'console_tags' %}?id={{ t.id }}" title="Remove">
                            <span class="glyphicon glyphicon-remove-circle"></span>
                        </a>
                    </td>
                </tr>
            {% endfor %}
            </tbody>
        </table>
    </div>

{% endblock %}
