{% load helpers %}

<div class="card">
  <h2 class="card-header">Related Objects</h2>
  <ul class="list-group list-group-flush" role="presentation">

    {% if context.slave %}
      <a href="{% url 'dcim:site_list' %}?{{context.slave}}" class="list-group-item list-group-item-action d-flex justify-content-between">
    {% else %}
      <a class="list-group-item list-group-item-action d-flex justify-content-between">
    {% endif %}
        Slaves sites

        {% if context.count_slave > 0 %}
          <span class="badge text-bg-primary rounded-pill">{{context.count_slave}}</span>
        {% else %}
          <span class="badge text-bg-light rounded-pill">&mdash;</span>
        {% endif %}

      </a>

    {% if context.slave_infra %}
      <a href="{% url 'plugins:sop_infra:sopinfra_list' %}?{{context.slave_infra}}" class="list-group-item list-group-item-action d-flex justify-content-between">
    {% else %}
      <a class="list-group-item list-group-item-action d-flex justify-content-between">
    {% endif %}
        Slaves infrastructures

        {% if context.count_slave > 0 %}
          <span class="badge text-bg-primary rounded-pill">{{context.count_slave_infra}}</span>
        {% else %}
          <span class="badge text-bg-light rounded-pill">&mdash;</span>
        {% endif %}

      </a>

  </ul>
</div>
