{% extends "base.html.j2" %}

{% block title %}
Releases
{% endblock %}

{% block javascripts %}
{{ super() }}
<script defer type="module" src="/s/dist/releasePage.bundle.js"></script>
{% endblock javascripts %}

{% block body %}
    <div class="container my-2 rounded overflow-hidden shadow-sm bg-light-three p-4">
        {% for release in releases if release.enabled %}
            <div class="row rounded overflow-hidden shadow-sm bg-white mb-2">
                <div class="col-8 release-card" data-argus-release-name="{{ release.name }}">
                    <div class="card-body">
                            <h3 class="card-title">{{ release.name if not release.pretty_name else release.pretty_name }}</h3>
                            <p class="card-subtitle text-muted">{{ release.description if release.description else "No description provided" }}</p>
                            <div class="release-stats mb-1"></div>
                    </div>
                </div>
                <div class="col-4 p-2">
                    <div class="d-flex justify-content-center flex-column">
                        <div class="btn-group">
                            <a href="{{ url_for('main.release_dashboard', release_name=release.name) }}" class="btn btn-outline-success"><i class="fas fa-tachometer-alt"></i> Dashboard</a>
                            <a href="{{ url_for('main.release_planner', name=release.name) }}" class="btn btn-outline-success"><i class="fas fa-calendar-alt"></i> Release Planner</a>
                        </div>
                        {% if not release.perpetual %}
                            <a class="link-secondary" href="{{ url_for('main.release_scheduler', name=release.name) }}">Legacy Scheduler</a>
                        {% else %}
                            <a href="{{ url_for('main.duty_planner', name=release.name) }}" class="link-secondary">Legacy Duty Planning</a>
                        {% endif %}
                    </div>
            </div>
                </div>
        {% endfor %}
    </div>
{% endblock %}
