{% extends 'base.html' %}

{% block breadcrumb %}
  {% include 'crudlfap/_breadcrumb_object.html' %}
{% endblock %}

{% block content %}
<div class="">
  <table class="table">
    <thead class="thead-inverse">
      {% for field in view.display_fields %}
      <tr>
        <th>
          {{ field['field'].verbose_name.capitalize() }}
        </th>
        <td>
          {% if getattr(field['value'], 'all', None) %}
            <ul class="collection">
              {% for value in field['value'].all() %}
                <li class="collection-item">{{ value }}</li>
              {% endfor %}
            </ul>
          {% elif getattr(field['value'], 'get_absolute_url', None) %}
            <a
                href="{{ field['value'].get_absolute_url() }}"
            >{{ field['value'] }}</a>
          {% else %}
              {{ field['value'] }}
          {% endif %}
        </td>
      </tr>
      {% endfor %}
    </tbody>
  </table>
</div>
{% endblock %}
