{% extends 'generic/object.html' %}
{% load i18n %}
{% load netbox_dhcp %}
{% load plugins %}

{% block control-buttons %}
{% if object.standard %}
{% else %}
{{ block.super }}
{% endif %}
{% endblock control-buttons %}

{% block content %}
    <div class="row">
        <div class="col col-md-6">
            <div class="card">
                <h5 class="card-header">{% trans "Option Definition" %}</h5>
                <table class="table table-hover attr-table">
                    <tr>
                        <th scope="row">{% trans "Address Family" %}</th>
                        <td>{{ object.get_family_display }}</td>
                    </tr>
                    <tr>
                        <th scope="row">{% trans "Space" %}</th>
                        <td>{{ object.space }}</td>
                    </tr>
                    <tr>
                        <th scope="row">{% trans "Name" %}</th>
                        <td>{{ object.name|linkify }}</td>
                    </tr>
                    <tr>
                        <th scope="row">{% trans "Code" %}</th>
                        <td>{{ object.code }}</td>
                    </tr>
                    {% if object.description %}
                    <tr>
                        <th scope="row">{% trans "Description" %}</th>
                        <td style="word-break:break-all;">{{ object.description }}</td>
                    </tr>
                    {% endif %}
                </table>
            </div>
            {% if object.dhcp_server or object.client_class %}
            <div class="card">
                <h5 class="card-header">{% trans "Parent Object" %}</h5>
                <table class="table table-hover attr-table">
                    {% if object.dhcp_server %}
                        <tr>
                            <th scope="row">{% trans "DHCP Server" %}</th>
                            <td>{{ object.dhcp_server }}</td>
                        </tr>
                    {% endif %}
                    {% if object.client_class %}
                        <tr>
                            <th scope="row">{% trans "Client Class" %}</th>
                            <td>{{ object.client_class }}</td>
                        </tr>
                    {% endif %}
                </table>
            </div>
            {% endif %}
            {% include 'inc/panels/custom_fields.html' %}
            {% include 'inc/panels/comments.html' %}
            {% plugin_left_page object %}
        </div>
        <div class="col col-md-6">
            <div class="card">
                <h5 class="card-header">{% trans "Fields" %}</h5>
                <table class="table table-hover attr-table">
                    <tr>
                        <th scope="row">{% trans "Type" %}</th>
                        <td>{{ object.get_type_display }}</td>
                    </tr>
                    {% if object.type == "record" %}
                    <tr>
                        <th scope="row">{% trans "Record Types" %}</th>
                        <td>{{ object.record_types|display_list }}</td>
                    </tr>
                    {% endif %}
                    <tr>
                        <th scope="row">{% trans "Encapsulate" %}</th>
                        <td>{% null_checkmark object.encapsulate %}</td>
                    </tr>
                    <tr>
                        <th scope="row">{% trans "Array" %}</th>
                        <td>{% null_checkmark object.array %}</td>
                    </tr>
                </table>
            </div>
            {% include 'inc/panels/tags.html' %}
            {% plugin_right_page object %}
        </div>
    </div>
    <div class="row">
        <div class="col col-md-12">
            {% plugin_full_width_page object %}
        </div>
    </div>
{% endblock %}
