{% extends 'generic/object.html' %}
{% load buttons %}
{% load custom_links %}
{% load helpers %}
{% load perms %}
{% load plugins %}

{% block title %}{{ object.value }} nm{% endblock %}

{% block breadcrumbs %}
  <li><a href="{% url 'plugins:netbox_optics:opticalgridtype' pk=object.grid_type.pk %}">{{ object.grid_type.name }}</a></li>
  <li>{{ object.value }} nm</li>
{% endblock %}

{% block buttons %}
  {% if perms.netbox_optics.change_opticalgridtypewavelength %}
    <a href="{% url 'plugins:netbox_optics:opticalgridtypewavelength_edit' pk=object.pk %}" class="btn btn-warning">
      <span class="mdi mdi-pencil" aria-hidden="true"></span> Edit
    </a>
  {% endif %}
  {# Delete action temporarily disabled pending backend support #}
{% endblock %}

{% block controls %}
  <div class="controls">
    <div class="control-group">
      {% plugin_buttons object %}

      {% block extra_controls %}{% endblock %}

      {% if perms.extras.add_bookmark and object.bookmarks %}
        {% bookmark_button object %}
      {% endif %}
      {% if request.user|can_add:object %}
        {% clone_button object %}
      {% endif %}
      {% if request.user|can_change:object %}
        {% edit_button object %}
      {% endif %}
      {# Delete button intentionally omitted until backend route exists #}

    </div>
    <div class="control-group">
      {% custom_links object %}
    </div>
  </div>
{% endblock controls %}

{% block content %}
<div class="row">
    <div class="col-md-12">
        <div class="row">
            <div class="col-md-6">
                <div class="panel panel-default">
                    <div class="panel-heading">
                        <strong>Grid Type Wavelength</strong>
                    </div>
                    <table class="table table-hover panel-body attr-table">
                        <tr>
                            <td>Value</td>
                            <td>{{ object.value }} nm</td>
                        </tr>
                        <tr>
                            <td>Grid Type</td>
                            <td><a href="{% url 'plugins:netbox_optics:opticalgridtype' pk=object.grid_type.pk %}">{{ object.grid_type.name }}</a></td>
                        </tr>
                    </table>
                </div>
            </div>
        </div>
    </div>
</div>

{% endblock %} 