{% extends "pretixcontrol/base.html" %}
{% load i18n %}
{% load bootstrap3 %}
{% block title %}{% trans "Your applications" %}{% endblock %}
{% block content %}
    <h1>{% trans "Your applications" %}</h1>
    {% if applications %}
        <div class="table-responsive">
            <table class="table table-condensed table-hover">
                <thead>
                <tr>
                    <th>{% trans "Name" %}</th>
                    <th class="action-col-2"></th>
                </tr>
                </thead>
                <tbody>
                {% for application in applications %}
                    <tr>
                        <td><strong><a href="{% url "control:user.settings.oauth.app" pk=application.pk %}">{{ application.name }}</a></strong></td>
                        <td class="text-right flip">
                            <a href="{% url "control:user.settings.oauth.app" pk=application.pk %}" class="btn btn-default btn-sm"><i class="fa fa-edit"></i></a>
                            <a href="{% url "control:user.settings.oauth.app.roll" pk=application.pk %}" class="btn btn-default btn-sm"><i class="fa fa-repeat"></i></a>
                            <a href="{% url "control:user.settings.oauth.app.disable" pk=application.pk %}" class="btn btn-danger btn-sm"><i class="fa fa-trash"></i></a>
                        </td>
                    </tr>
                {% endfor %}
                </tbody>
            </table>
        </div>
        <p>
            <a class="btn btn-primary" href="{% url "control:user.settings.oauth.apps.register" %}">
                <span class="fa fa-plus"></span>
                {% trans "Create new application" %}
            </a>
        </p>
    {% else %}
        <div class="empty-collection">
            <p>
                {% blocktrans trimmed %}
                    No applications registered yet.
                {% endblocktrans %}
            </p>

            <a href="{% url "control:user.settings.oauth.apps.register" %}"
               class="btn btn-primary btn-lg">
                {% trans "Register a new application" %}
            </a>
        </div>
    {% endif %}
{% endblock %}
