{% extends 'generic/object.html' %}
{% load helpers %}
{% load humanize %}
{% load plugins %}

{% block title %}{{ object.name }}{% endblock %}

{% block breadcrumbs %}
{% if object.kind != None %}
  {{ block.super }}
  <li class="breadcrumb-item">
    <a href="{% url 'plugins:netbox_firmware:bios_list' %}?{{ object.kind }}_type_id={{ object.hardware_type.pk }}&manufacturer={{object.hardware_type.manufacturer.id}}">{{ object.hardware_type.manufacturer }} {{ object.hardware_type }}</a>
  </li>
{% endif %}
{% endblock %}

{% block content %}
  <div class="row mb-3">
    <div class="col col-md-6">
      <div class="card">
        <h5 class="card-header">Bios</h5>
        <table class="table table-hover attr-table">
          <tr>
            <th scope="row">Name</th>
            <td>{{ object.name|placeholder }}</td>
          </tr>
          <tr>
            <th scope="row">Status</th>
            <td>{% badge object.get_status_display bg_color=object.get_status_color %}</td>
          </tr>
          <tr>
            <th scope="row">Description</th>
            <td>{{ object.description|placeholder }}</td>
          </tr>
          <tr>
            <th scope="row">File name</th>
            <td>{{ object.file_name|placeholder }}</td>
          </tr>
          <tr>
            <th scope="row">File</th>
            <td>{{ object.file|placeholder }}</td>
          </tr>
        </table>
      </div>

      <div class="card">
        <h5 class="card-header">Hardware</h5>
        <table class="table table-hover attr-table">
          <tr>
            <th scope="row">Manufacturer</th>
            <td><a href="{{object.manufacturer.get_absolute_url}}">{{ object.manufacturer|placeholder }}</a></td>
          </tr>
          {% if object.kind == 'device' %}
            <tr>
              <th scope="row">Device Type</th>
              <td><a href="{{ object.hardware_type.get_absolute_url }}">{{ object.hardware_type }}</a></td>
            </tr>
          {% elif object.kind == 'module' %}
            <tr>
              <th scope="row">Module Type</th>
              <td><a href="{{ object.hardware_type.get_absolute_url }}">{{ object.hardware_type }}</a></td>
            </tr>
          {% endif %}
        </table>
      </div>

      {% include 'inc/panels/custom_fields.html' %}
      {% plugin_left_page object %}
    </div>
    <div class="col col-md-6">
      {% include 'inc/panels/comments.html' %}
      {% plugin_right_page object %}
    </div>
  </div>
  <div class="row mb-3">
    <div class="col col-md-12">
      {% plugin_full_width_page object %}
    </div>
  </div>
{% endblock content %}