{% extends "base.html" %}
{% comment %}
SPDX-License-Identifier: GPL-3.0-or-later
{% endcomment %}
{% load render_table from django_tables2 %}
{% load i18n %}

{% block content %}
<div class="card bg-light mb-3">
    <h3 class="card-header text-center">
	{% trans "Meal served" %}
    </h3>
    {% if can_create_meal %}
    <div class="card-footer">
	<a class="btn btn-sm btn-success" href="{% url 'food:transformed_create' %}" data-turbolinks="false">
	    {% trans 'New meal' %}
	</a>
    </div>
    {% endif %}
    {% if served.data %}
    {% render_table served %}
    {% else %}
    <div class="card-body">
	<div class="alert alert-warning">
	    {% trans "There is no meal served." %}
	</div>
    </div>
    {% endif %}
</div>

<div class="card bg-light mb-3">
    <h3 class="card-header text-center">
	{% trans "Open" %}
    </h3>
    {% if open.data %}
    {% render_table open %}
    {% else %}
    <div class="card-body">
	<div class="alert alert-warning">
	    {% trans "There is no free meal." %}
	</div>
    </div>
    {% endif %}
</div>

<div class="card bg-light mb-3">
    <h3 class="card-header text-center">
        {% trans "All meals" %}
    </h3>
    {% if table.data %}
    {% render_table table %}
    {% else %}
    <div class="card-body">
        <div class="alert alert-warning">
            {% trans "There is no meal." %}
        </div>
    </div>
    {% endif %}
</div>
{% endblock %}
