Make markup semantic + add semantic DOM principle (todo §1); page <h1>, skip link, row-header <th scope=row>, descriptive error pages
This commit is contained in:
@@ -8,8 +8,8 @@
|
||||
</head>
|
||||
<body>
|
||||
<main>
|
||||
<h1>403</h1>
|
||||
<p>You don't have access to that.</p>
|
||||
<h1>Access denied</h1>
|
||||
<p>You don't have permission to view that (403).</p>
|
||||
<p><a href="/">Back home</a></p>
|
||||
</main>
|
||||
</body>
|
||||
|
||||
@@ -8,8 +8,8 @@
|
||||
</head>
|
||||
<body>
|
||||
<main>
|
||||
<h1>404</h1>
|
||||
<p>That page does not exist.</p>
|
||||
<h1>Page not found</h1>
|
||||
<p>We couldn't find that page (404).</p>
|
||||
<p><a href="/">Back home</a></p>
|
||||
</main>
|
||||
</body>
|
||||
|
||||
@@ -8,8 +8,8 @@
|
||||
</head>
|
||||
<body>
|
||||
<main>
|
||||
<h1>500</h1>
|
||||
<p>Something went wrong on our end.</p>
|
||||
<h1>Something went wrong</h1>
|
||||
<p>An unexpected error occurred on our end (500).</p>
|
||||
<p><a href="/">Back home</a></p>
|
||||
</main>
|
||||
</body>
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
columns: { label, sortable?, sort?: "asc"|"desc", href?, className? }[]
|
||||
rows: { name?, cells: Cell[], actions?: Action[] }[]
|
||||
Cell ∈ string | { text, className? } | { user:{name,initials} } | { badge:{tone,label} } | { html, className? }
|
||||
user cells render as <th scope="row"> — they identify the row (the row header).
|
||||
Action = { label, icon?, href?, danger?, separatorBefore? }
|
||||
%><%
|
||||
const caption = locals.caption;
|
||||
@@ -46,7 +47,7 @@
|
||||
<% if (typeof cell === "string") { -%>
|
||||
<td><%= cell %></td>
|
||||
<% } else if (cell.user) { -%>
|
||||
<td><span class="cell-user"><span class="avatar" aria-hidden="true"><%= cell.user.initials %></span><span class="cell-strong"><%= cell.user.name %></span></span></td>
|
||||
<th scope="row"><span class="cell-user"><span class="avatar" aria-hidden="true"><%= cell.user.initials %></span><span class="cell-strong"><%= cell.user.name %></span></span></th>
|
||||
<% } else if (cell.badge) { -%>
|
||||
<td><span class="badge <%= cell.badge.tone %>"><span class="dot"></span><%= cell.badge.label %></span></td>
|
||||
<% } else if (cell.html != null) { -%>
|
||||
|
||||
@@ -21,6 +21,7 @@
|
||||
<link rel="icon" href="/public/favicon.svg" />
|
||||
</head>
|
||||
<body>
|
||||
<a class="skip-link" href="#main-content">Skip to content</a>
|
||||
<%- include("icons") %>
|
||||
<!-- nav-toggle drives the mobile overlay (pure CSS) -->
|
||||
<input type="checkbox" id="nav-toggle" aria-hidden="true" tabindex="-1" />
|
||||
@@ -67,10 +68,10 @@
|
||||
<!-- scrim closes the mobile menu (label toggles the checkbox) -->
|
||||
<label class="scrim" for="nav-toggle" aria-label="Close menu"></label>
|
||||
|
||||
<main class="content">
|
||||
<main class="content" id="main-content">
|
||||
<header class="topbar">
|
||||
<label class="btn icon-btn hamburger" for="nav-toggle" aria-label="Open menu"><svg class="ico"><use href="#i-menu" /></svg></label>
|
||||
<div><div class="page-title"><%= title %></div></div>
|
||||
<h1 class="page-title"><%= title %></h1>
|
||||
<% if (breadcrumbs.length) { %>
|
||||
<nav class="crumbs" aria-label="Breadcrumb">
|
||||
<% breadcrumbs.forEach((c, i) => { %><% if (i) { %><span class="sep">/</span><% } %><% if (c.href) { %><a href="<%= c.href %>"><%= c.label %></a><% } else { %><span><%= c.label %></span><% } %><% }) %>
|
||||
|
||||
Reference in New Issue
Block a user