{% extends 'base.html' %}

{% load widget_tweaks %}

{% block content %}

<section>
    <h4 class="display-titre" style="cursor: default;">My projects</h4>

    <div class="row">
        <div class="col-sm-6">
            <span class="badge badge-pill badge-secondary">{{ filter.qs|length }}</span>
            <span class="texte-badge">projects found</span>
        </div>
        <div class="col-sm-6 text-right">
            <a class="add-link btn btn-primary" href="{% url 'core:projects-new' %}">Add project</a>
        </div>
    </div>

    <table id="table" class="table table-striped table-bordered table-hover">
        <thead>
            <tr>
                <th>Name</th>
                <th>Creation date</th>
                <th>Author</th>
                <th>Delete</th>
            </tr>
        </thead>
        <tbody>
            {% for project in filter.qs %}
            <tr>
                <td><i class="fa fa-laptop fa-1x laptop ic-w mx-1"></i><a
                        href="{% url 'core:projects-details' project.id %}">{{ project.name }}</a></td>
                <td>{{ project.date_created }}</td>
                <td>{{ project.author }}</td>
                <td><a href='projects/{{ project.id }}/delete/project/{{ project.id }}'><i
                            class="fa fa-times fa-1x"></i></a>
                </td>
            </tr>
            {% endfor %}
        </tbody>
    </table>
</section>
{% endblock %}