<section class="section">
  <p class="eyebrow">Admin</p>
  <h1>Evenimente</h1>
  <p>Aprobare, publicare, suspendare si acces rapid la modulele festival.</p>

  <div class="table-wrap">
    <table>
      <thead><tr><th>Eveniment</th><th>Organizator</th><th>Categorie</th><th>Oras</th><th>Vanzari</th><th>Status</th><th>Actiuni</th><th>Module</th></tr></thead>
      <tbody>
        <% events.forEach((event) => { %>
          <tr>
            <td><strong><%= event.title %></strong><br><small><%= event.start_at || '-' %></small></td>
            <td><%= event.organization_name || '-' %></td>
            <td><%= event.category_name || '-' %></td>
            <td><%= event.city_name || '-' %></td>
            <td><%= event.tickets_sold || 0 %> bilete<br><small><%= Number(event.gross_sales || 0).toFixed(2) %> RON</small></td>
            <td><%- include('../partials/status-badge', { status: event.status }) %></td>
            <td>
              <form method="post" action="/admin/events/<%= event.id %>/status" class="inline-admin-form">
                <%- include('../partials/csrf-field') %>
                <select name="status">
                  <% ['draft', 'pending_review', 'published', 'paused', 'sold_out', 'cancelled', 'completed', 'rejected'].forEach((status) => { %>
                    <option value="<%= status %>" <%= event.status === status ? 'selected' : '' %>><%= status %></option>
                  <% }) %>
                </select>
                <button>Salveaza</button>
              </form>
            </td>
            <td class="actions-cell">
              <a class="button ghost" href="/admin/events/<%= event.id %>/festival">Festival</a>
              <a class="button ghost" href="/admin/events/<%= event.id %>/scanner">Scanner</a>
              <a class="button ghost" href="/admin/events/<%= event.id %>/live-stats">Live stats</a>
              <a class="button ghost" href="/admin/events/<%= event.id %>/cashless">Cashless</a>
              <a class="button ghost" href="/admin/events/<%= event.id %>/wristbands">Bratari</a>
              <a class="button ghost" href="/admin/events/<%= event.id %>/checkins">Check-in</a>
              <a class="button ghost" href="/admin/events/<%= event.id %>/invitations">Invitatii</a>
              <a class="button ghost" href="/admin/events/<%= event.id %>/vendors">Vendors</a>
              <a class="button ghost" href="/admin/events/<%= event.id %>/local-gateways">Gateway</a>
              <a class="button ghost" href="/admin/events/<%= event.id %>/nfc-writer">NFC</a>
              <a class="button ghost" href="/admin/events/<%= event.id %>/emergency">Emergency</a>
            </td>
          </tr>
        <% }) %>
      </tbody>
    </table>
  </div>
</section>
