{% extends "base.html" %}

{% from "macros.html" import diagram, workouts_table with context %}

{% block title %}Workouts{% endblock %}

{% block content_title %}Workouts{% endblock %}

{% block content %}
{{ diagram("workouts", intervals, current) }}
<div class="container has-text-centered">
    <form action="{{ url_for('workouts_view') }}" method="post">
        <div class="field has-addons has-addons-centered mx-2">
            <div class="control">
                <input class="input" type="date" name="date" value="{{ today }}" required="required" />
            </div>
            <div class="control">
                <div class="select">
                    <select name="routine">
                        {% for name in routines %}
                        <option>{{ name }}</option>
                        {% endfor %}
                    </select>
                </div>
            </div>
            <div class="control">
                <input class="button is-success" type="submit" value="Create" />
            </div>
        </div>
    </form>
</div>
<div class="table-container mt-4">
    {{ workouts_table(workouts) }}
</div>
{% endblock %}

{% set parent_page = 'index_view' %}
