{% extends theme('base.html') %}

{% block style %}
    <link href="/static/datatables/jquery.dataTables.min.css" rel="stylesheet">
    <link href="/static/datatables/dataTables.semanticui.min.css" rel="stylesheet">
{% endblock %}

{% block script %}
    <script src="/static/datatables/jquery.dataTables.min.js"></script>
    <script src="/static/datatables/dataTables.semanticui.min.js"></script>
    <script src="/static/js/users.js"></script>
{% endblock %}

{% block content %}

    <div class="ui segment">
        <a class="ui primary button" href="{{ url_for('oidc.clients.add') }}">{% trans %}Add client{% endtrans %}</a>
    </div>

    <table class="ui table">
        <thead>
            <th></th>
            <th>{% trans %}Name{% endtrans %}</th>
            <th>{% trans %}URL{% endtrans %}</th>
            <th>{% trans %}Created{% endtrans %}</th>
        </thead>
        {% for client in clients %}
            <tr>
                <td>
                    <a href="{{ url_for('oidc.clients.edit', client_id=client.client_id) }}">
                        {% if client.logo_uri %}
                            <img class="ui avatar image" src="{{ client.logo_uri }}" alt="Client logo">
                        {% else %}
                            <i class="plug circular inverted black icon"></i>
                        {% endif %}
                    </a>
                </td>
                <td><a href="{{ url_for('oidc.clients.edit', client_id=client.client_id) }}">{{ client.client_name }}</a></td>
                <td><a href="{{ client.client_uri }}">{{ client.client_uri }}</a></td>
                <td>{% if client.client_id_issued_at %}{{ client.client_id_issued_at }}{% endif %}</td>
            </tr>
        {% endfor %}
    </table>

{% endblock %}
