{% extends "./template.html" %}
{% block content %}
{% load static %}
    <div class="card mt-4">
        <div class="card-header">
            <h2>Search Users</h2>
        </div>
        <div class="card-body">
            <form action={% url 'search_users' %} method="post" class="search_users">
                {% csrf_token %}
                <div class="form-row">
                    <div class="w-75">{{ search_form.search_for }}</div>
                    <div class="w-25"><input type="submit" value="Search Users" class="btn btn-primary form-control"></div>
                </div>
                <a href="{% url 'new_user' %}">New User</a>
                <table class="table table-hover table-striped">
                    <thead>
                        <tr>
                            <td>Username</td>
                            <td>First Name</td>
                            <td>Last Name</td>
                            <td>Email</td>
                        </tr>
                    </thead>
                    {% for row in user_results %}
                        <tr>
                            <td><a href="{% url 'user_information' row.id %}">{{ row.username }}</a></td>
                            <td>{{ row.first_name }}</td>
                            <td>{{ row.last_name }}</td>
                            <td>{{ row.email }}</td>
                        </tr>
                    {% endfor %}
                </table>
            </form>
        </div>
    </div>
{% endblock %}