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

{% block content %}

<h2>SeriesFinding Migration Status</h2>

<form method="get" class="mb-3">
    <label>
        <input type="checkbox" name="hide_no_series" value="1" {% if request.GET.hide_no_series %}checked{% endif %}>
        Hide findings with no series
    </label>
    <button type="submit" class="btn btn-sm btn-primary ms-2">Apply</button>
</form>

<table class="table table-bordered table-sm">
    <thead>
        <tr>
            <th>ID</th>
            <th>Description</th>
            <th>Series</th>
            <th>annotation_json_3d</th>
            <th>viewer_state_3d</th>
        </tr>
    </thead>
    <tbody>
        {% for f in findings_status %}
            {% if not request.GET.hide_no_series or f.series %}
            <tr>
                <td>{{ f.id }}</td>
                <td>{{ f.str }}</td>
                <td>
                    {% if f.series %}
                        <a href="{% url 'atlas:series_detail' f.series.pk %}">{{ f.series }}</a>
                    {% else %}
                        <span class="text-muted">None</span>
                    {% endif %}
                </td>
                <td>
                    {% if f.annotation_json_3d %}
                        <span class="badge bg-success">Populated</span>
                    {% else %}
                        <span class="badge bg-danger">Empty</span>
                    {% endif %}
                </td>
                <td>
                    {% if f.viewer_state_3d %}
                        <span class="badge bg-success">Populated</span>
                    {% else %}
                        <span class="badge bg-danger">Empty</span>
                    {% endif %}
                </td>
            </tr>
            {% endif %}
        {% endfor %}
    </tbody>
</table>
    
{% endblock content %}