{% extends "base.html" %}

{% block title %}Bioregistry Metaregistry{% endblock %}

{% block container %}
    <div class="card">
        <div class="card-header">
            <div class="row align-items-center">
                <div class="col-8"><h5 style="margin: 0">Metaregistry</h5></div>
                <div class="col-4 text-right">
                    <div class="dropdown">
                        <button class="btn btn-sm btn-outline-dark dropdown-toggle" type="button"
                                id="dropdownMenuButton" data-toggle="dropdown" aria-haspopup="true"
                                aria-expanded="false">
                            Download
                        </button>
                        <div class="dropdown-menu" aria-labelledby="dropdownMenuButton">
                            {% for label, key in formats %}
                                <a class="dropdown-item"
                                   href="{{ url_for("api.metaresources", format=key) }}">
                                    {{ label }} <i class="fas fa-download"></i>
                                </a>
                            {% endfor %}
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <div class="card-body">
            <p>
                The metaregistry contains metadata about registries including their names, descriptions, and their
                various capabilities such as their ability to act as a resolver.
            </p>
        </div>
        <table id="table-entries" class="table table-striped table-hover ">
            <thead>
            <tr>
                <td>Name</td>
                <td>Metaprefix</td>
                <td>Description</td>
            </tr>
            </thead>
            {% for row in rows %}
                <tr>
                    <td>
                        <a href="{{ url_for('ui.metaresource', metaprefix=row.prefix) }}">{{ row.name }}</a>
                    </td>
                    <td class="text-nowrap"><code>{{ row.prefix }}</code></td>
                    <td><small>{{ row.description }}</small></td>
                </tr>
            {% endfor %}
        </table>
    </div>
{% endblock %}
