{% extends 'layouts/admin.twig' %}

{% block content %}

    <ul class="breadcrumbs el">
        <li><a href="/admin/">Home</a> /</li>
        <li class="end">{{ page_meta.title }}</li>
    </ul>

    <h1>{{ page_meta.title }}</h1>

    {% include 'admin/messages.twig' %}

    {% if installed %}
        {% include 'DeliveryCouriers/admin/configuration.twig' %}

        {% if services is not empty %}
            <h3>List of supported Services</h3>
            <table class="tabular">
                <thead>
                <tr>
                    <th>Courier</th>
                    <th>Service</th>
                </tr>
                </thead>
                {% for service in services %}
                    <tr>
                        <td>{{ service.courier_name }}</td>
                        <td>{{ service.name }}</td>
                    </tr>
                {% endfor %}

            </table>
        {% endif %}
    {% else %}
        <form action="{{ self }}" method="post">
            <div class="row">
                <label for="account_name">
                    Account Name
                </label>
                <input type="text"
                       id="account_name"
                       name="account"
                       value="{{ request.account ?: config('app.name') }}"/>
            </div>
            {% include 'DeliveryCouriers/admin/notify_urls.twig' %}
            <button type="submit" name="action" value="initialize" class="btn">
                Initialize Courier Link
            </button>
        </form>
    {% endif %}

{% endblock %}