favoritter/web/templates/pages/admin_requests.html
Ole-Morten Duesund a64d0c5dff fix: address a11y code review findings
Bugs fixed:
- Space key was hijacked in tag input when a suggestion was
  highlighted, preventing users from typing spaces. Removed
  Space as a selection key (Enter is sufficient per combobox
  pattern).
- ArrowUp was clamped to index 0, making it impossible to
  deselect all suggestions and return to free typing. Now
  allows arrowing back to -1 which clears aria-activedescendant.

Cleanup:
- Remove dead inline onkeydown handlers from tag suggestion
  <li> elements (tabindex="-1" means they never receive focus,
  so the handlers never fire; the global keydown listener in
  app.js handles keyboard navigation).
- Add outline to aria-selected="true" state for visual parity
  with hover (keyboard users now see the same indicator).
- Announce "Ingen forslag" in live region when suggestions are
  empty (screen readers previously got silence).
- Add responsive table wrapper to admin tags and admin requests
  tables (was only on admin users).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-29 17:58:40 +02:00

46 lines
1.9 KiB
HTML

{{define "head"}}
<meta name="robots" content="noindex">
{{end}}
{{define "content"}}
<h1>Registreringsforespørsler</h1>
{{with .Data}}
{{if .Requests}}
<div class="table-responsive" role="region" aria-label="Forespørsler" tabindex="0">
<table role="grid">
<thead>
<tr>
<th scope="col">Brukernavn</th>
<th scope="col">Sendt</th>
<th scope="col">Handlinger</th>
</tr>
</thead>
<tbody>
{{range .Requests}}
<tr>
<td>{{.Username}}</td>
<td>{{.CreatedAt.Format "02.01.2006 15:04"}}</td>
<td>
<form method="POST" action="{{basePath}}/admin/signup-requests/{{.ID}}" class="inline-form">
<input type="hidden" name="csrf_token" value="{{$.CSRFToken}}">
<input type="hidden" name="action" value="approve">
<button type="submit" class="outline primary nav-button">Godkjenn</button>
</form>
<form method="POST" action="{{basePath}}/admin/signup-requests/{{.ID}}" class="inline-form">
<input type="hidden" name="csrf_token" value="{{$.CSRFToken}}">
<input type="hidden" name="action" value="reject">
<button type="submit" class="outline secondary nav-button"
onclick="return confirm('Avvis forespørselen fra «{{.Username}}»?')">Avvis</button>
</form>
</td>
</tr>
{{end}}
</tbody>
</table>
</div>
{{else}}
<p>Ingen ventende forespørsler.</p>
{{end}}
{{end}}
{{end}}