{% extends "pretixcontrol/base.html" %}
{% load i18n %}
{% load bootstrap3 %}
{% load urlreplace %}
{% load eventurl %}
{% block title %}{% trans "Organizers" %}{% endblock %}
{% block content %}
	<h1>{% trans "Organizers" %}</h1>
    <p>{% trans "The list below shows all organizer accounts you have administrative access to." %}</p>
    <div class="panel panel-default">
        <div class="panel-heading">
            <h3 class="panel-title">
                {% trans "Filter" %}
            </h3>
        </div>
        <form class="panel-body filter-form" action="" method="get">
            <div class="row">
                <div class="col-md-12 col-sm-6 col-xs-12">
                    {% bootstrap_field filter_form.query layout='inline' %}
                </div>
            </div>
            <div class="text-right flip">
                <button class="btn btn-primary btn-lg" type="submit">
                    <span class="fa fa-filter"></span>
                    {% trans "Filter" %}
                </button>
            </div>
        </form>
    </div>
    {% if staff_session %}
        <p>
            <a href="{% url "control:organizers.add" %}" class="btn btn-default">
                <span class="fa fa-plus"></span>
                {% trans "Create a new organizer" %}
            </a>
        </p>
    {% endif %}
	<table class="table table-condensed table-hover">
		<thead>
			<tr>
                <th>
                    {% trans "Organizer name" %}
                    <a href="?{% url_replace request 'ordering' '-name' %}"><i class="fa fa-caret-down"></i></a>
                    <a href="?{% url_replace request 'ordering' 'name' %}"><i class="fa fa-caret-up"></i></a>
                </th>
                <th>
                    {% trans "Short form" %}
                    <a href="?{% url_replace request 'ordering' '-slug' %}"><i class="fa fa-caret-down"></i></a>
                    <a href="?{% url_replace request 'ordering' 'slug' %}"><i class="fa fa-caret-up"></i></a>
                </th>
			</tr>
		</thead>
		<tbody>
			{% for o in organizers %}
			<tr>
				<td><strong>
                    <a href="{% url "control:organizer" organizer=o.slug %}">{{ o.name }}</a>
                </strong></td>
                <td>{{ o.slug }}</td>
			</tr>
			{% endfor %}
		</tbody>
	</table>
    {% include "pretixcontrol/pagination.html" %}
{% endblock %}
