{% extends "web/_base.html" %}
{% block navbar_left %}
    {{ block.super }}
    {% include "web/_collection-menu.html" with collection=collection only %}
{% endblock %}
{% block title %}{{ item.name }} in {{ collection.name }}@{{ collection.category }}{% endblock %}
{% block content %}
    <h1>{{ item.name }} in {{ collection.name }}@{{ collection.category }}</h1>
    <h2>Details</h2>
    <table class="table table-hover">
        <tbody>
            {% if item.collection %}
                <tr>
                    <th>Collection</th>
                    <td>
                        <a href="{{ item.collection.get_absolute_url }}">{{ item.collection.name }}@{{ item.collection.category }}</a>
                    </td>
                </tr>
            {% elif item.artifact %}
                <th>Artifact</th>
                <td>
                    <a href="{% url 'artifacts:detail' artifact_id=item.artifact.pk %}">{{ item.name }}</a>
                </td>
            {% endif %}
            <tr>
                <th>Category</th>
                <td>{{ item.category }}</td>
            </tr>
            <tr>
                <th>Created at</th>
                <td>{{ item.created_at|date:'Y-m-d H:i' }}</td>
            </tr>
            <tr>
                <th>User</th>
                <td>{{ item.created_by_user }}</td>
            </tr>
            {% if data_yaml %}
                <tr>
                    <th>Data</th>
                    <td>
                        <pre>{{data_yaml}}</pre>
                    </td>
                </tr>
            {% endif %}
        </tbody>
    </table>
{% endblock %}
