{% extends "generic/object.html" %}
{% load render_table from django_tables2 %}
{% load plugins %}
{% load i18n %}
{% block content %}
    <div class="row mb-3">
        <div class="col col-md-6">
            <div class="card">
                <h5 class="card-header">Authorized Key Details</h5>
                <div class="card-body">
                    <table class="table table-hover attr-table">
                        <tr>
                            <th scope="row">Username</th>
                            <td>{{ object.username }}</td>
                        </tr>
                        <tr>
                            <th scope="row">Full Name</th>
                            <td>{{ object.full_name }}</td>
                        </tr>
                        <tr>
                            <th scope="row">Description</th>
                            <td>{{ object.description }}</td>
                        </tr>
                    </table>
                </div>
            </div>
            <div class="card">
                <h5 class="card-header">Public Key</h5>
                <div class="card-body">
                    <pre class="ssh-key"
                         style="white-space: pre-wrap;
                                word-break: break-all;
                                font-family: monospace">{{ object.public_key }}</pre>
                </div>
            </div>
            {% include "inc/panels/custom_fields.html" %}
            {% plugin_left_page object %}
        </div>
        <div class="col col-md-6">
            {% include "inc/panels/tags.html" %}
            {% include "inc/panels/comments.html" %}
            {% plugin_right_page object %}
        </div>
    </div>
    <div class="row">
        <div class="col col-md-12">
            <div class="card">
                <h5 class="card-header">{% trans "Devices" %}</h5>
                {% if device_ids %}
                    {% htmx_table 'dcim:device_list' id=device_ids %}
                {% else %}
                    <div class="card-body">
                        <p>{% trans "No devices available." %}</p>
                    </div>
                {% endif %}
            </div>
        </div>
    </div>
    <div class="row">
        <div class="col col-md-12">
            <div class="card">
                <h5 class="card-header">{% trans "Virtual Machines" %}</h5>
                {% if virtual_machine_ids %}
                    {% htmx_table 'virtualization:virtualmachine_list' id=virtual_machine_ids %}
                {% else %}
                    <div class="card-body">
                        <p>{% trans "No Virtual Machines available." %}</p>
                    </div>
                {% endif %}
            </div>
        </div>
    </div>
    <div class="row">
        <div class="col col-md-12">{% plugin_full_width_page object %}</div>
    </div>
{% endblock content %}
