{% extends 'generic/object.html' %}
{% load buttons %}
{% load custom_links %}
{% load helpers %}
{% load plugins %}
{% load tabs %}
{% load i18n %}
{% load perms %}
{% load render_table from django_tables2 %}
{% block controls %}
  <div class="btn-list justify-content-end mb-2">
    {% plugin_buttons object %}
    {# Add/edit/delete/etc. buttons #}
    {% block control-buttons %}
      {# Extra buttons #}
      {% block extra_controls %}{% endblock %}
      {# Default buttons #}
      {% if request.user|can_change:object %}
        {% edit_button object %}
      {% endif %}
    {% endblock control-buttons %}
  </div>
  {# Custom links #}
  <div class="d-flex justify-content-end">
    <div class="btn-list">
      {% block custom-links %}
        {% custom_links object %}
      {% endblock custom-links %}
    </div>
  </div>
{% endblock controls %}
{% block content %}
  <div class="row mb-3">
    <div class="col col-md-6">
      <div class="card">
        <h5 class="card-header">Service Path</h5>
        <table class="table table-hover attr-table">
          <tr>
            <th scope="row">Name</th>
            <td>{{ object.name }}</td>
          </tr>
          <tr>
            <th scope="row">State</th>
            <td>{{ object.state }}</td>
          </tr>
          <tr>
            <th scope="row">Kind</th>
            <td>{{ object.kind }}</td>
          </tr>
        </table>
      </div>
      {% include 'inc/panels/custom_fields.html' %}
      {% plugin_left_page object %}
    </div>
    <div class="col col-md-6">
      {% include 'inc/panels/tags.html' %}
      {% include 'inc/panels/comments.html' %}
      {% plugin_right_page object %}
    </div>
  </div>
  <div class="row">
    <div class="col col-12">
      {% load render_table from django_tables2 %}
      <div class="card">
        <h5 class="card-header">Segments</h5>
        {% htmx_table 'plugins:komora_service_path_plugin:servicepathsegmentmapping_list' service_path_id=object.pk %}
      </div>
    </div>
  </div>
  <div class="row">
    <div class="col col-md-12">{% plugin_full_width_page object %}</div>
  </div>
{% endblock content %}
