{% extends "base.html" %}{% load static %}
{% block title %} {{ title }}{% endblock %}
{% block page_heading %}
    <div class="row d-none" >
        <div hidden class="col">
            <div class="container m-2">
                <div class="container m-2">
                    <div class="btn-group">
                        <form action="">
                            <a class="btn btn-sm btn-outline-primary text-nowrap" href="{% url 'teamsnap_schedule' team_id=team_id%}?filters=no_past">No Past Events</a>
                            <button class="btn btn-sm btn-outline-primary text-nowrap">Games Only</button>
                        </form>
                    </div>
                </div>
            </div>
        </div>
    </div>

{% endblock %}
{% block content %}
    {% load tz %}
    <div class="">
        <h3 class="mb-2">
            Schedule
        </h3>
        <div class="card">
            <div class="card-body p-0">
                <div class="table-responsive">
                    <table class="table table-striped table-sm">
                        {#    <thead>#}
                        {#    </thead>#}
                        <tbody>
                        {% for event in events %}
                            <tr class="small">
                                <th>
                                    {{ event.data.formatted_title }}
                                </th>
                                <td class="">
                                    {{ event.data.start_date|localtime|date:"D"}}
                                </td>
                                <td>
                                    {{ event.data.start_date|localtime|date:"M j"}}
                                </td>
                                <td class="d-none d-md-table-cell">
                                    {{ event.data.start_date|localtime|date:"Y"}}
                                </td>
                                <td>
                                    {{ event.data.start_date|localtime|date:"g:i A"}}
                                </td>
                                <td class="small">
                                    {{ event.data.location_name }}
                                </td>
                                <td>
                                    <a class="btn btn-outline-secondary btn-sm" href="{% url 'teamsnap_view_event' event_id=event.data.id team_id=request.user.profile.teamsnapsettings.managed_team.id%}"><i class="bi bi-three-dots"></i></a>
                                </td>
                            </tr>
                        {% endfor %}
                        </tbody>
                    </table>
                </div>
            </div>
        </div>
    </div>
{% endblock %}