<% layout('layouts/print') %>
    <% const dayNames = ["Sun","Mon","Tue","Wed","Thu","Fri","Sat"]; %>
        <h1 class="display-3 mt-5">
            <%= event.name %>
        </h1>
        <p class="lead mb-0">
            Hosted By the
            <%= event.eventHost.name %>
        </p>
        <p class="lead mt-0 mb-5">
            <small><%= dateOutput(event.eventStart) %>
                <% if (dateOutput(event.eventStart) != dateOutput(event.eventEnd)) { %> to
                <%= dateOutput(event.eventEnd) %>
                <% } %>
                </small></p>
        <p class="display-5 text-danger mt-5 pt-5" style="page-break-after:always;">Medical Details: Confidential</p>
        <table class="table table-striped">
            <thead>
                <th scope="col">Player Name</th>
                <th scope="col">Medical Details</th>
            </thead>
            <tbody>
                <% for (attendee of event.attendees.sort((a,b) => ('' + a.surname).localeCompare(b.surname) || ('' + a.firstname).localeCompare(b.firstname))){ %>
                    <% if (attendee.user.medicalInfo && attendee.user.medicalInfo != '') { %>
                        <tr scope="row">
                            <td width="250px">
                                <%= attendee.surname %>,
                                    <%= attendee.firstname %>
                            </td>
                            <td class="ms-0">
                                <%= attendee.user.medicalInfo %>
                            </td>
                        </tr>
                        <% }}  %>
            </tbody>
        </table>