{% extends 'core/lcars_app.html' %}
{% load static %}

{% block header_title %}{% block app_title %}
Tune Source Extraction
{% endblock %}{% endblock %}

{% block left_menu %}
<a href="{% url 'processing:select_starfind_batch_refresh' %}">
    <div class="lcars-element 
                button 
                lcars-melrose-bg
                lcars-u-1-1">
        Refresh
    </div>
</a>
{% endblock left_menu %}

{% block main %}

{% for imtype_entry in batches %}

<h3>{{imtype_entry.0}} Images</h3>
<table class="lcars-table standard-header">
    <thead>
        <tr>
            <th>Batch</th>
            <th>Num. Images</th>
        </tr>
    </thead>
    <tbody class="lcars-table select-row">
    {% for batch_info in imtype_entry.1 %}
    {% if not batch_info.2 %}
    {% url 'processing:tune_starfind' imtype=imtype_entry.0 batch_index=forloop.counter0 as target_url %}
    <tr onclick="window.location='{{target_url}}'">
        <td> {{batch_info.0}} </td>
        <td> {{batch_info.1}} </td>
    </tr>
    {% endif %}
    {% endfor %}
    </tbody>
</table>
{% endfor %}
{% endblock main %}
