{% extends "base.html" %}

{% block title %} | Connected applications{% endblock %}

{% block main %}
        <div class="page-header">
            <div class="container">
                <h1>Applications</h1>

                <ul class="nav nav-tabs header-nav">
                    <li role="presentation"><a href="{% url 'admin:app_overview' %}">Registered applications</a></li>
                    <li role="presentation" class="active"><a href="{% url 'admin:app_connected' %}">Connected applications</a></li>
                </ul>
            </div>
        </div>

        <div class="container">
            {% include 'snippets/messages.html' %}

            <div class="row">
                <div class="col-sm-4">
                    <div class="alert alert-info">
                        <p>Connected applications are applications that you have used before to access and edit data stored in {{ PLATFORM_NAME }}.</p>
                    </div>
                </div>

                <div class="col-sm-8">
                    <h3 class="header">
                        Your connected applications
                    </h3>
                    {% for app in connected_apps %}

                    {% if forloop.first %}
                    <ul class="list-unstyled overview-list">
                    {% endif %}

                    <li>
                        <a href="{% url 'admin:app_disconnect' app.id %}" class="btn btn-default pull-right">Disconnect</a>
                        <h4>{{ app.name }}</h4>
                        {% if app.description %}<p>{{app.description}}</p>{% endif %}
                    </li>

                    {% if forloop.last %}
                    </ul>
                    {% endif %}
                    {% empty %}
                        <div class="well empty-list">
                            <p class="lead">You haven't connected any applications yet.</p>
                        </div>
                    {% endfor %}
                </div>
            </div>
        </div>
{% endblock %}
