<div class="container mx-auto px-4 py-8">
  <div class="max-w-xl mx-auto bg-white shadow rounded p-6">
    <h1 class="text-2xl font-bold mb-4">Kullanıcı Rolleri - <%= user.username %></h1>
    <form action="/users/<%= user.id %>/roles" method="POST">
      <input type="hidden" name="_csrf" value="<%= csrfToken %>">
      <div class="mb-4">
        <label class="block text-sm font-medium text-gray-700 mb-2">Roller</label>
        <div class="space-y-2">
          <% (roles || []).forEach(function(r){ %>
            <label class="inline-flex items-center space-x-2">
              <input type="checkbox" name="roles" value="<%= r.id %>" <%= selected.has(String(r.id)) ? 'checked' : '' %>>
              <span><%= r.name %></span>
            </label>
          <% }) %>
        </div>
      </div>
      <div class="flex justify-end space-x-2">
        <a href="/users" class="px-4 py-2 border rounded">Geri</a>
        <button type="submit" class="px-4 py-2 bg-indigo-600 text-white rounded">Kaydet</button>
      </div>
    </form>
  </div>
</div>
