{% extends 'base_assets.html' %}
{% block title %}Supplier | {{ object.name }}{% endblock %}

{% block content %}
<div class="row">
        {% if not request.is_ajax %}
            <div class="col-sm-12">
                <h1>Supplier | {{ object.name }}</h1>
            </div>

            <div class="col-sm-12 text-right">
                <div class="btn-group btn-page">
                    <a href="{% url 'supplier_update' object.pk %}" class="btn btn-default"><span
                        class="glyphicon glyphicon-pencil"></span> Edit</a>
                </div>
            </div>
        {% endif %}
        <div class="col-sm-6">
            <div class="panel panel-info">
                <div class="panel-heading">Supplier Details</div>
                <div class="panel-body">
                    <dl class="dl-horizontal">
                        <dt>Name</dt>
                        <dd>{{ object.name }}</dd>
                    </dl>                        
                </div>
            </div>
        </div>
    </div>

    <div class="row">
        <div class="col-sm-12">
            <div class="panel panel-default">
                <div class="panel-heading">Associated Assets</div>
                <div class="panel-body">
                      <table class="table">
                          <thead>
                            <tr>
                              <th>Asset ID</th>
                              <th>Description</th>
                              <th>Category</th>
                              <th>Status</th>
                              <th class="hidden-xs">Quick Links</th>
                            </tr>
                          </thead>
                          <tbody id="asset_table_body">
                            {% with object.assets.all as object_list %}
                                {% include 'partials/asset_list_table_body.html' %}
                            {% endwith %}
                          </tbody>
                       </table>
                </div>
            </div>
        </div>
    </div>


    {% if not request.is_ajax %}
        <div class="row">
            <div class="col-sm-12 text-right">
                <div class="btn-group btn-page">
                    <a href="{% url 'supplier_update' object.pk %}" class="btn btn-default"><span
                        class="glyphicon glyphicon-pencil"></span> Edit</a>
                </div>
                <div>
                    <a href="{% url 'supplier_update' object.pk %}" title="View Revision History">
                        Last edited {{ object.last_edited_at }} by {{ object.last_edited_by.name }}
                    </a>
                </div>
            </div>
        </div>
    {% endif %}
{% endblock %}
