<section class="section">
  <p class="eyebrow">Admin</p>
  <h1>Organizatori</h1>
  <p>Aprobare, suspendare si verificare organizatori.</p>

  <div class="table-wrap">
    <table>
      <thead><tr><th>Organizatie</th><th>Owner</th><th>CUI</th><th>Comision</th><th>Evenimente</th><th>Status</th><th>Actiuni</th></tr></thead>
      <tbody>
        <% organizations.forEach((organization) => { %>
          <tr>
            <td><strong><%= organization.name %></strong><br><small><%= organization.legal_name || '-' %></small></td>
            <td><%= organization.owner_name || '-' %><br><small><%= organization.owner_email || '-' %></small></td>
            <td><%= organization.cui || '-' %></td>
            <td><%= organization.commission_rate %>%</td>
            <td><%= organization.events_count || 0 %></td>
            <td><%- include('../partials/status-badge', { status: organization.status }) %></td>
            <td>
              <form method="post" action="/admin/organizations/<%= organization.id %>/status" class="inline-admin-form">
                <%- include('../partials/csrf-field') %>
                <select name="status">
                  <% ['approved', 'pending', 'suspended', 'rejected'].forEach((status) => { %>
                    <option value="<%= status %>" <%= organization.status === status ? 'selected' : '' %>><%= status %></option>
                  <% }) %>
                </select>
                <button>Salveaza</button>
              </form>
            </td>
          </tr>
        <% }) %>
      </tbody>
    </table>
  </div>
</section>
