{% extends "layout.html" %}
{% set active_id = "verification_requests_outgoing" %}
{% from "_macros.html" import render_verification_request_review_status_pill, render_pagination %}
{%- block title -%}
{{ _('Outgoing verification requests') }}
{%- endblock -%}
{% block content %}

<h1 class="mb-1">
    {{ _('Outgoing verification requests') }}
    <a class="btn btn-outline-secondary btn-sm m-1" href="{{ url_for('manage_admin_unit_verification_requests_outgoing_create_select', id=admin_unit.id) }}" role="button"><i class="fa fa-plus"></i> {{ _('Request verification') }}</a>
    {% if config["DOCS_URL"] %}
        <a class="btn btn-outline-info btn-sm m-1 my-auto float-right" href="{{ config["DOCS_URL"] }}/goto/organization-verify" target="_blank" rel="noopener noreferrer" role="button"><i class="fa fa-fw fa-info-circle"></i> {{ _('Docs') }}</a>
    {% endif %}
</h1>

<ul class="list-group mt-4">
    {% for request in requests %}
        <li class="list-group-item">
            <div class="dropdown d-inline-block">
                <button class="btn btn-link dropdown-toggle" type="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">{{ request.target_admin_unit.name }}</button>
                <div class="dropdown-menu">
                    <a class="dropdown-item" href="{{ url_for('admin_unit_verification_request_review_status', id=request.id) }}">{{ _('Show review status') }}</a>
                    <a class="dropdown-item" href="{{ url_for('admin_unit_verification_request_delete', id=request.id) }}">{{ _('Delete request') }}&hellip;</a>
                </div>
            </div>
            {{ render_verification_request_review_status_pill(request) }}
        </li>
    {% endfor %}
</ul>

<div class="my-4">{{ render_pagination(pagination) }}</div>

{% endblock %}