{% extends base_template %}
{% load debusine %}
{% block navbar_left %}
    {{ block.super }}
    {% include "web/_collection-menu.html" with collection=collection only %}
{% endblock %}
{% block content %}
    <div class="row">
        <div class="col-6">
            <form method="post">
                {% csrf_token %}
                <p class="fs-3">
                    <span class="text-danger">Delete</span> collection relation:
                </p>
                <table class="table table-sm table-hover table-striped">
                    <tbody>
                        <tr>
                            <th>From</th>
                            <td>
                                <a href="{{ collection_relation.source.get_absolute_url }}">{{ collection_relation.source }}</a>
                            </td>
                        </tr>
                        <tr>
                            <th>To</th>
                            <td>
                                <a href="{{ collection_relation.target.get_absolute_url }}">{{ collection_relation.target }}</a>
                            </td>
                        </tr>
                        <tr>
                            <th>Type</th>
                            <td>{{ collection_relation.get_type_display }}</td>
                        </tr>
                        <tr>
                            <th>Position</th>
                            <td>{{ collection_relation.position|default_if_none:"-" }}</td>
                        </tr>
                    </tbody>
                </table>
                <div class="btn-group mt-4"
                     role="group"
                     aria-label="Confirm/cancel buttons">
                    <button class="btn btn-danger" type="submit">Delete</button>
                    <a class="btn btn-primary"
                       href="{% url "workspaces:collections:collection_relations:list" wname=collection.workspace.name ccat=collection.category cname=collection.name %}">Cancel</a>
                </div>
            </form>
        </div>
    </div>
{% endblock %}
