{% extends 'base.html' %}

{% block title %}main todo{% endblock %}

{% block content %}
    <div class="col-12 d-block justify-content-center mt-5" align="center">
        <div class="col-5">
            {% if tasks|length < 1 %}
                <h4><strong>there is no task created</strong></h4>
            {% else %}
            <table class="table" align="center">
                <tr>
                    <td><strong>task</strong></td>
                    <td><strong>created date</strong></td>
                    <td><strong>actions</strong></td>
                </tr>
                {% for task in tasks %}
                <tr>
                    <td><strong>{{ task.content }}</strong></td>
                    <td><strong>{{ task.created_data.date() }}</strong></td>
                    <td><strong><a href="/delete/{{ task.id }}">delete</a></strong></td>
                </tr>
                {% endfor %}
            </table>
            {% endif %}
        </div>
        <div class="row col-5 justify-conent-center p-7">
            <form action="/" method="post">
                <table>
                    <tr>
                        <td><input type="text" class="form-control" name="content" id="content" placeholder="enter some tasks here"></td>
                        <td><input type="submit" value="send data" class="btn btn-outline-primary"></td>
                    </tr>
                </table>
            </form>
        </div>
    </div>
{% endblock %}