<%- include('header.html', { pageTitle, extraStyles, extraScripts }) %> <% function formatDate(date){ let sdate = date.toLocaleDateString('es-MX', { year: 'numeric', month: 'long', day: 'numeric' }); return sdate } function formatTime(date){ return date.toLocaleTimeString('es-MX', { hour: '2-digit', minute: '2-digit', second: undefined }); } function getSport(sport){ return {pickleball:'Pickleball', padel:'Padel', beach_tennis:'Beach Tennis'}[sport] } %>

Panel de Control

<% if (currentTournaments.length > 0) { %>

Torneo Actual

<% for(tour of currentTournaments){ %>
<%= tour.sport %>

<%= tour.name %>

<%= tour.location %> • <%= formatDate(tour.start_date) %> al <%= formatDate(tour.end_date) %>

<% } %>
<% } %>

Próximos Torneos

<% if (nextTournaments.length > 0) { %>
<% nextTournaments.forEach(function(t) { %> <% }) %>
Nombre Deporte Ubicación Fecha Estado Acción
<%= t.name %> <%= getSport(t.sport) %> <%= t.location %> <%= formatDate(t.start_date) %> <% if (t.status === 'proximo') { %>Próximo<% } %> <% if (t.status === 'comenzado') { %>Comenzado<% } %> <% if (t.status === 'finalizado') { %>Finalizado<% } %> Editar Ver
<% } %>
<% if (pastTournaments.length > 0) { %>

Últimos Torneos

<% pastTournaments.forEach(function(t) { %> <% }) %>
Nombre Deporte Ubicación Fecha Estado Acción
<%= t.name %> <%= getSport(t.sport) %> <%= t.location %> <%= formatDate(t.start_date) %> <% if (t.status === 'proximo') { %>Próximo<% } %> <% if (t.status === 'comenzado') { %>Comenzado<% } %> <% if (t.status === 'finalizado') { %>Finalizado<% } %> Editar Ver
<% } %>
<%- include('footer.html', { extraScripts }) %>