{% extends 'jsondataferret/base.html' %}

{% block breadcrumbs %}
    <nav aria-label="breadcrumb">
      <ol class="breadcrumb">
        <li class="breadcrumb-item"><a href="{% url 'jsondataferret_index' %}">Home</a></li>
        <li class="breadcrumb-item"><a href="{% url 'jsondataferret_type_list' %}">Types</a></li>
        <li class="breadcrumb-item"><a href="{% url 'jsondataferret_type_index' public_id=type.public_id %}">Type {{ type.title }}</a></li>
        <li class="breadcrumb-item"><a href="{% url 'jsondataferret_record_index' type_id=type.public_id record_id=record.public_id %}">Record {{ record.public_id }}</a></li>
        <li class="breadcrumb-item active" aria-current="page">Events</li>
      </ol>
    </nav>
{% endblock %}

{% block content %}

    <h2>Type {{ type.title }} record {{ record.public_id }}</h2>

    {% if events %}
        <table class="table">
            <tr>
                <th>At</th>
                <th>By</th>
                <th>Comment</th>
                <th>&nbsp;</th>
            </tr>
            {% for event in events %}
                <tr>
                    <td>{{ event.created }}</td>
                    <td>{{ event.user }}</td>
                    <td>{{ event.comment |linebreaks}}</td>
                    <td><a href="{% url 'jsondataferret_event_index' event_id=event.public_id %}" class="btn btn-primary">View</a></td>
                </tr>
            {% endfor %}
        </table>
    {% else %}
        <p>No events are available.</p>
    {% endif %}

{% endblock %}
