{% extends 'generic/object.html' %}
{% load render_table from django_tables2 %}

{% block content %}
  <div class="row mb-3">

    <div class="col col-md-6">
      <div class="card">
        <h5 class="card-header">Device</h5>
        <div class="card-body">
          <table class="table table-hover attr-table">
            <tr>
              <th scope="row">Device</th>
              <td>{{ object.device|linkify }}</td>
            </tr>
            <tr>
              <th scope="row">Manufacturer</th>
              <td>{{ object.device.device_type.manufacturer|linkify }}</td>
            </tr>
            <tr>
              <th scope="row">Model</th>
              <td>{{ object.device.device_type|linkify }}</td>
            </tr>
            <tr>
              <th scope="row">Serialnumber</th>
              <td>{{ object.device.serial }}</td>
            </tr>
          </table>
        </div>
      </div>
    </div>

    <div class="col col-md-6">
      <div class="card">
        <h5 class="card-header">Location</h5>
        <div class="card-body">
          <table class="table table-hover attr-table">
            <tr>
              <th scope="row">Site</th>
              <td>{{ object.device.site|linkify }}</td>
            </tr>
            <tr>
              <th scope="row">Rack / Face / HE</th>
              <td>{{ object.device.rack|linkify }} / {{ object.device.face }} / {{ object.device.position }}</td>
            </tr>
            <tr>
              <th scope="row">Site Physical address</th>
              <td>{{ object.device.site.physical_address|linkify }}</td>
            </tr>
            <tr>
              <th scope="row">Site Shipping address</th>
              <td>{{ object.device.site.shipping_address|linkify }}</td>
            </tr>
          </table>
        </div>
      </div>
    </div>

    <div class="col col-md-6">
      <div class="card">
        <h5 class="card-header">Maintenance Supplier</h5>
        <div class="card-body">
          <table class="table table-hover attr-table">
            <tr>
              <th scope="row">Supplier</th>
              <td>{{ object.contract.supplier|linkify }}</td>
            </tr>
            <tr>
              <th scope="row">Address</th>
              <td>{{ object.contract.supplier.physical_address }}</td>
            </tr>
            <tr>
              <th scope="row">Country</th>
              <td>{{ object.contract.supplier.country }}</td>
            </tr>
            <tr>
              <th scope="row">Phone</th>
              <td>{{ object.contract.supplier.phone }}</td>
            </tr>
            <tr>
              <th scope="row">Email</th>
              <td>{{ object.contract.supplier.email }}</td>
            </tr>
            <tr>
              <th scope="row">Portal Url</th>
              <td>{{ object.contract.supplier.portal_url }}</td>
            </tr>
          </table>
        </div>
      </div>
    </div>

    <div class="col col-md-6">
      <div class="card">
        <h5 class="card-header">Maintenance Contract</h5>
        <div class="card-body">
          <table class="table table-hover attr-table">
            <tr>
              <th scope="row">Description</th>
              <td>{{ object.contract.description }}</td>
            </tr>
            <tr>
              <th scope="row">Contract number</th>
              <td>{{ object.contract.contract_number }}</td>
            </tr>
            <tr>
              <th scope="row">Start of contract</th>
              <td>{{ object.contract.start_of_contract }}</td>
            </tr>
            <tr>
              <th scope="row">End of contract</th>
              <td>{{ object.contract.end_of_contract }}</td>
            </tr>
            <tr>
              <th scope="row">Status</th>
              <td>{{ object.contract.status }}</td>
            </tr>
          </table>
        </div>
      </div>
    </div>

  </div>
  
  
{% endblock content %}