<%- include('../layout') %>

<h1>Mitarbeiter der Kommission zuweisen</h1>

<form action="/commission-users/<%= commissionId %>/users" method="post">

  <table class="table table-striped">
    <thead>
      <tr>
        <th>Mitarbeiter</th>
        <th>Zugewiesen</th>
      </tr>
    </thead>
    <tbody>
      <% users.forEach(u => { %>
        <tr>
          <td><%= u.username %></td>
          <td>
            <input type="checkbox" name="users" value="<%= u.id %>"
              <%= assignedIds.includes(u.id) ? 'checked' : '' %>>
          </td>
        </tr>
      <% }) %>
    </tbody>
  </table>

  <button class="btn btn-success">Speichern</button>
</form>

<%- include('../footer') %>
