{% extends 'base_assets.html' %}
{% load button from filters %}
{% load cache %}

{% block content %}
    <div class="row">
        <div class="col-sm-12">
            <div class="col">
                <div class="card">
                    <dl class="card-body row">
                        <dt class="col-6">Socket</dt>
                        <dd>{{ object.socket|default_if_none:'-' }}</dd>

                        <dt class="col-6">Plug</dt>
                        <dd>{{ object.plug|default_if_none:'-' }}</dd>

                        <dt class="col-6">Circuits</dt>
                        <dd>{{ object.circuits|default_if_none:'-' }}</dd>

                        <dt class="col-6">Cores</dt>
                        <dd>{{ object.cores|default_if_none:'-' }}</dd>
                    </dl>
                </div>
            </div>
            <div class="col mt-2 text-right">
                {% button 'edit' url='cable_type_update' pk=object.id %}
            </div>
            {% cache None cable_type_assets object %}
                <div class="col mt-2">
                    <div class="card">
                        <div class="card-header">Associated Assets</div>
                        {% with object.asset_set.all as object_list %}
                            {% include 'partials/asset_list_table.html' %}
                        {% endwith %}
                    </div>
                </div>
            {% endcache %}
        </div>
    </div>
{% endblock %}