{% extends "base.html" %}
{% block content %}
<div class="container-fluid">
    <div class="row">
        <div class="col-md-12">
            <div class="card">
                <div class="card-header">
                    <h3 class="card-title">Projects</h3>
                </div>
                <div class="card-body">
                    <div class="row mb-3">
                        <div class="col-md-12">
                            <form method="get">
                                <div class="row">
                                    <div class="col-md-3">
                                        <input type="text" name="q" class="form-control" placeholder="Search..." value="{{ request.GET.q }}">
                                    </div>
                                    <div class="col-md-2">
                                        <input type="date" name="start_date" class="form-control" placeholder="Start Date" value="{{ request.GET.start_date }}">
                                    </div>
                                    <div class="col-md-2">
                                        <input type="date" name="end_date" class="form-control" placeholder="End Date" value="{{ request.GET.end_date }}">
                                    </div>
                                    <div class="col-md-1">
                                        <button type="submit" class="btn btn-primary">Filter</button>
                                    </div>
                                    <div class="col-md-4 text-right">
                                        <a href="#" class="btn btn-success">Add New Project</a>
                                    </div>
                                </div>
                            </form>
                        </div>
                    </div>
                    <table class="table table-bordered">
                        <thead>
                            <tr>
                                <th>Name</th>
                                <th>Description</th>
                                <th>Start Date</th>
                                <th>End Date</th>
                                <th>Actions</th>
                            </tr>
                        </thead>
                        <tbody>
                            {% for project in projects %}
                            <tr>
                                <td>{{ project.name }}</td>
                                <td>{{ project.description }}</td>
                                <td>{{ project.start_date }}</td>
                                <td>{{ project.end_date }}</td>
                                <td>
                                    <a href="#" class="btn btn-sm btn-primary">View</a>
                                </td>
                            </tr>
                            {% endfor %}
                        </tbody>
                    </table>
                </div>
            </div>
        </div>
    </div>
</div>
{% endblock %}
