Tag autocomplete combobox pattern (WCAG 2.1.1, 4.1.2, 4.1.3): - Add role="combobox", aria-expanded, aria-haspopup to tag input - Implement arrow key navigation (up/down) through suggestions - Add Space key support alongside Enter for selecting tags - Manage aria-activedescendant to track highlighted option - Add Escape to close suggestions - Add aria-live="polite" status region announcing suggestion count - Add aria-selected state on options - Tag suggestions now have stable IDs for activedescendant Focus visibility (WCAG 2.4.7): - Remove outline:none on tag suggestions, replace with visible 2px solid outline on :focus-visible Contrast (WCAG 1.4.3): - Replace opacity:0.5 on disabled rows with muted text color and strikethrough on username (maintains 4.5:1 ratio) Structure and semantics (WCAG 1.3.1): - Fix heading hierarchy H1→H3 skip in import.html (now H2) - Replace <nav> misuse for fave actions with div[role="group"] - Add aria-label="Administrasjonsmeny" to admin dashboard nav - Wrap admin users table in responsive scrollable region - Remove redundant "Bilde for:" prefix from image alt text - Make error page H1 descriptive: "Feil 404: Ikke funnet" - Add .sr-only utility class for screen-reader-only content - Add hreflang="en" to English-language external link Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
74 lines
2.7 KiB
HTML
74 lines
2.7 KiB
HTML
{{define "head"}}
|
|
<meta name="robots" content="noindex">
|
|
{{end}}
|
|
|
|
{{define "content"}}
|
|
<h1>Brukere</h1>
|
|
|
|
<article>
|
|
<h2>Opprett ny bruker</h2>
|
|
<form method="POST" action="{{basePath}}/admin/users">
|
|
<input type="hidden" name="csrf_token" value="{{.CSRFToken}}">
|
|
<div class="grid">
|
|
<label for="username">
|
|
Brukernavn
|
|
<input type="text" id="username" name="username" required
|
|
pattern="[a-zA-Z0-9_-]+" minlength="2" maxlength="30">
|
|
</label>
|
|
<label for="role">
|
|
Rolle
|
|
<select id="role" name="role">
|
|
<option value="user">Bruker</option>
|
|
<option value="admin">Administrator</option>
|
|
</select>
|
|
</label>
|
|
</div>
|
|
<button type="submit">Opprett bruker</button>
|
|
<small>Brukeren vil få et midlertidig passord og må endre det ved første innlogging.</small>
|
|
</form>
|
|
</article>
|
|
|
|
{{with .Data}}
|
|
<div class="table-responsive" role="region" aria-label="Brukertabell" tabindex="0">
|
|
<table role="grid">
|
|
<thead>
|
|
<tr>
|
|
<th scope="col">Brukernavn</th>
|
|
<th scope="col">Visningsnavn</th>
|
|
<th scope="col">Rolle</th>
|
|
<th scope="col">Status</th>
|
|
<th scope="col">Opprettet</th>
|
|
<th scope="col">Handlinger</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
{{range .Users}}
|
|
<tr {{if .Disabled}}class="disabled-row"{{end}}>
|
|
<td><a href="{{basePath}}/u/{{.Username}}">{{.Username}}</a></td>
|
|
<td>{{.DisplayName}}</td>
|
|
<td>{{.Role}}</td>
|
|
<td>
|
|
{{if .Disabled}}Deaktivert
|
|
{{else if .MustResetPassword}}Må endre passord
|
|
{{else}}Aktiv{{end}}
|
|
</td>
|
|
<td>{{.CreatedAt.Format "02.01.2006"}}</td>
|
|
<td>
|
|
<form method="POST" action="{{basePath}}/admin/users/{{.ID}}/reset-password" class="inline-form">
|
|
<input type="hidden" name="csrf_token" value="{{$.CSRFToken}}">
|
|
<button type="submit" class="outline secondary nav-button">Tilbakestill passord</button>
|
|
</form>
|
|
<form method="POST" action="{{basePath}}/admin/users/{{.ID}}/toggle-disabled" class="inline-form">
|
|
<input type="hidden" name="csrf_token" value="{{$.CSRFToken}}">
|
|
<button type="submit" class="outline {{if .Disabled}}primary{{else}}secondary{{end}} nav-button">
|
|
{{if .Disabled}}Aktiver{{else}}Deaktiver{{end}}
|
|
</button>
|
|
</form>
|
|
</td>
|
|
</tr>
|
|
{{end}}
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
{{end}}
|
|
{{end}}
|