{% extends 'atlas/exams.html' %}



{% block content %}

    {% include 'atlas/partials/_viewing_case_as_part_of_collection.html' with nav_link_view="atlas:collection_case_priors" %}

    <h2 class="mb-3">Managing Priors for Case: <a href="{% url 'atlas:case_detail' casedetail.case.pk %}" class="text-decoration-none">{{casedetail.case.title}}</a></h2>

    <div class="card mb-4">
        <div class="card-body">
            <p class="mb-1">This page allows you to add series from prior cases to a case in a collection. In order to be available here the cases must be linked on the system.</p>
            <p class="mb-0">It is necessary to give a description of how the cases are related that will be displayed to the user when viewing the case.</p>
        </div>
    </div>

    <h3 class="mb-3">Available Prior Exams</h3>

    <div class="row g-3 mb-4">
        {% for case, added, relation, visibility, relation_type in available_priors %}
            {% include 'atlas/partials/_prior_card.html' with case=case added=added relation=relation visibility=visibility relation_type=relation_type collection=collection %}
        {% empty %}
            <div class="col-12">
                <div class="alert alert-info">No available prior exams found for the case.</div>
            </div>
        {% endfor %}
    </div>

    <h3 class="mb-3">Available Future Exams</h3>

    <div class="row g-3 mb-4">
        {% for case, added, relation, visibility, relation_type in available_futures %}
            {% include 'atlas/partials/_prior_card.html' with case=case added=added relation=relation visibility=visibility relation_type=relation_type collection=collection %}
        {% empty %}
            <div class="col-12">
                <div class="alert alert-info">No available future exams found for the case.</div>
            </div>
        {% endfor %}
    </div>



{% comment %}     <form method="POST">
        {% csrf_token %}
        {{ form }}
        <button type="submit" value="save" name="submit">Submit</button>
    </form> {% endcomment %}

{% comment %}     <h2>Blank form</h2>
    <form>
        {{ blank_form}}
    </form> {% endcomment %}



{% endblock %}

{% block css %}
    <style>
        .added {
            border: 1px solid green;
        }

        .not-added {
            border: 1px solid white;
        }
    </style>
{% endblock %}

{% block js %}


{% endblock %}