{% extends "./template.html" %}
{% block content %}
{% load static %}
    <div class="card mt-4">
        <div class="card-header">
            <h2>Kanban List</h2>
        </div>
        <div class="card-body">
            <form action={% url 'search_kanban' %} method="post" class="search_kanban">
                {% csrf_token %}
                <div class="form-row mb-4">
                    {{ search_kanban_form.search_kanban }}
                    <input type="submit" class="btn btn-primary form-control w-25">
                </div>
                <a href="{% url 'new_kanban_board' %}">New Board</a>
                <table class="table table-striped table-hover">
                    <thead>
                        <tr>
                            <td>Kanban Board</td>
                            <td>Creation Date</td>
                            {% if kanban_permission == 4 %}
                                <td>Properties</td>
                            {% endif %}
                        </tr>
                    </thead>
                    {% for row in kanban_board_results %}
                        <tr>
                            <td><a href="{% url 'kanban_information' row.kanban_board_id %}">{{ row.kanban_board_name }}</a></td>
                            <td>{{ row.date_created }}</td>
                            {% if kanban_permission == 4 %}
                                {% if row.requirement %}
                                    <td>------</td>
                                {% else %}
                                    <td><a href="{% url 'kanban_properties' row.kanban_board_id %}">Properties</a></td>
                                {% endif %}
                            {% endif %}
                        </tr>
                    {% endfor %}
                </table>
            </form>
        </div>
    </div>
{% endblock %}