{% extends "base.html" %}
{% load i18n %} 
{% load staticfiles %}

<!--
        Title
-->
{% block title %}{% trans "Exercises" %}{% endblock %}


<!--
        Main Content
-->
{% block content %}

<h2> {% trans "Exercises" %} </h2>

<p>
    <a href="/exercise/edit">{% trans "Add new exercise" %}</a> |
    <a href="/exercise/category/edit">{% trans "Add category" %}</a>
</p>

<table>
{% for category in categories %}
<tr>
    <th>
        {{ category.name }} <!--(ID {{ category.id}})-->
    </th>
    <td style="text-align: right;">
        <a href="/exercise/category/delete/{{ category.id }}"
           title="{% trans "Delete" %}">[x]</a>
        <a href="/exercise/category/edit/{{ category.id }}"
           title="{% trans "Edit" %}">[e]</a>
    </td>
</tr>

    {% for exercise in category.exercise_set.all %}
        <tr>
            <td colspan="2">
                <a href="/exercise/view/{{ exercise.id }}">{{ exercise.name }}</a>
            </td>
        <tr>
    {% endfor %}

{% endfor %}
</table>

{% endblock %}


<!--
        Side bar?
-->
{% extends "base.html" %}
{% load i18n %} 
{% load staticfiles %}

<!--
        Title
-->
{% block title %}{% trans "Exercises" %}{% endblock %}


<!--
        Main Content
-->
{% block content %}

<h2> {% trans "Exercises" %} </h2>

<p>
    <a href="/exercise/edit">{% trans "Add new exercise" %}</a> |
    <a href="/exercise/category/edit">{% trans "Add category" %}</a>
</p>

<table>
{% for category in categories %}
<tr>
    <th>
        {{ category.name }} <!--(ID {{ category.id}})-->
    </th>
    <td style="text-align: right;">
        <a href="/exercise/category/delete/{{ category.id }}"
           title="{% trans "Delete" %}">[x]</a>
        <a href="/exercise/category/edit/{{ category.id }}"
           title="{% trans "Edit" %}">[e]</a>
    </td>
</tr>

    {% for exercise in category.exercise_set.all %}
        <tr>
            <td colspan="2">
                <a href="/exercise/view/{{ exercise.id }}">{{ exercise.name }}</a>
            </td>
        <tr>
    {% empty %}
        <tr>
            <td colspan="2">
                <div class="box warning">
                    {% trans "No exercises in this category." %} {% trans "Use link to add one." %}
                </div>
            </td>
        <tr>
    {% endfor %}

{% endfor %}
</table>

{% endblock %}


<!--
        Side bar?
-->
Add info box for empty categories
Add info box for empty categories
