| 1 | {{/* list — GET /, the document list (spec §6.4). handlers.go's list |
| 2 | builds the view data: Title and the group labels already resolved |
| 3 | through rastrillo.T, EmptyTitle/EmptyBody the same; a document's |
| 4 | Title, When and excerpt are its own data and are printed as-is. |
| 5 | The newest five (splitRecent) are the shelf of pages ("tile"); the |
| 6 | rest, and every search result, are rows ("row"). |
| 7 | |
| 8 | The header's create <form> is the app's one create control (fix |
| 9 | round 1 on Task 1): a plain POST to /documents, no JavaScript. It |
| 10 | is outside the {{if .Groups}} branch below on purpose: the header |
| 11 | renders unconditionally, so the control reaches a person with no |
| 12 | documents yet exactly the same way it reaches everyone else, |
| 13 | rather than only appearing once there is something to list. |
| 14 | It is one button and no title field: the handler already names a |
| 15 | blank title "Untitled document", and the title is editable in the |
| 16 | document's own bar, which is where a person is when they know |
| 17 | what the document is called. Asking first put two text fields |
| 18 | side by side in the header, and the second read as a second |
| 19 | search box. |
| 20 | |
| 21 | [docs-header-actions] wraps the search form, that create form and |
| 22 | the Import link as one group opposite the title in |
| 23 | [docs-list-head] (on a phone it dissolves, display: contents, so |
| 24 | create sits by the title and search takes its own line). The two |
| 25 | forms stay two separate |
| 26 | <form>s, never one, because they are unrelated actions with |
| 27 | different methods and targets (GET / vs POST /documents) and must |
| 28 | never be merged into one submit. |
| 29 | |
| 30 | Sign-out (POST /signout, auth.go) used to be a form in that |
| 31 | wrapper. It is in the shell bar's account menu now — the same |
| 32 | control, in the same place, on every signed-in screen. It was |
| 33 | added to this header in a fix round once real sign-in existed and |
| 34 | nothing on the page could end a session; that is still the reason |
| 35 | it must exist somewhere, and a header holding search, create and |
| 36 | sign-out at once had become five controls on one line. |
| 37 | |
| 38 | Writes the bare rst-* attribute grammar throughout — the rst- |
| 39 | vocabulary always as a bare attribute, never as a class — which is |
| 40 | this app's whole-screen markup convention (Task 1's home page set |
| 41 | it). render_test.go's TestOurTemplatesUseTheAttributeGrammar walks |
| 42 | this file's own bytes to hold that; rastrillo's vendored shell and |
| 43 | partials keep their own class spelling, which is their output, not |
| 44 | this app's, and is out of that test's reach on purpose. The |
| 45 | [docs-*] selectors below are this app's own vocabulary, not |
| 46 | rastrillo's — SKILL.md §7's "ui is rastrillo's vocabulary, not |
| 47 | yours" is why they are not spelled rst-*, and they carry their |
| 48 | own tiny stylesheet here rather than a static/ file this |
| 49 | hand-built app does not otherwise have one of. */}} |
| 50 | {{/* The bar, the account menu and the <title> are the layout's |
| 51 | (views/layout.html, chrome.go): this screen defines only its content. |
| 52 | The bar names the app, "Docs"; the heading below names the screen, |
| 53 | "Documents". */}} |
| 54 | {{/* thumb — one document's page one, drawn from the line boxes |
| 55 | preview.go reports. aria-hidden because it is decorative: it is |
| 56 | wholly redundant with the document's own title beside it, and |
| 57 | there is no non-visual equivalent of "the shape of the |
| 58 | paragraphs" to offer instead. Deliberately no <title>, no role |
| 59 | and no tabindex — see AGENTS.md on a role being a promise. |
| 60 | |
| 61 | An empty .Thumb renders the bordered box with nothing in it, |
| 62 | which is what an empty document, and a document whose structure |
| 63 | could not be read, both get. */}} |
| 64 | {{define "thumb"}}<span docs-thumb aria-hidden="true">{{if .Bars}}<svg viewBox="0 0 {{.W}} {{.H}}" preserveAspectRatio="xMidYMin slice">{{range .Bars}}<rect x="{{.X}}" y="{{.Y}}" width="{{.W}}" height="{{.H}}"/>{{end}}</svg>{{end}}</span>{{end}} |
| 65 | {{/* tile — one of the newest documents, as its first page. The whole |
| 66 | tile is one link, paper, title and date: an overlay stretched from |
| 67 | the title missed the paper in Safari, where the line-clamped title |
| 68 | box clipped it. The link's name is its text, title first. */}} |
| 69 | {{define "tile"}}<li><a docs-tile href="{{.Href}}"> |
| 70 | <span docs-tile-title>{{.Title}}</span> |
| 71 | {{template "thumb" .Thumb}} |
| 72 | <span docs-tile-meta><span docs-row-when>{{.When}}</span>{{if .SharedNote}}<span docs-row-shared>{{.SharedNote}}</span>{{end}}</span> |
| 73 | </a></li>{{end}} |
| 74 | {{/* row — every older document, and every search result: rastrillo's |
| 75 | row, whose title link it stretches over the whole row itself. */}} |
| 76 | {{define "row"}}<div rst-row> |
| 77 | {{template "thumb" .Thumb}} |
| 78 | <span rst-row-main><a href="{{.Href}}">{{.Title}}</a>{{with .Thumb.Excerpt}}<span docs-row-excerpt>{{.}}</span>{{end}}</span> |
| 79 | {{if .SharedNote}}<span rst-muted docs-row-shared>{{.SharedNote}}</span>{{end}}<span docs-row-when>{{.When}}</span> |
| 80 | </div>{{end}} |
| 81 | {{define "content"}}<style> |
| 82 | /* The desk. The list is the person's documents laid out as the paper |
| 83 | they are, so the page under them is a desk rather than a form: the |
| 84 | suite's background, lit from above by a wash of Docs' own hue (the |
| 85 | icon's glow, estilo theme/apps.go hue 262, at the aurora's |
| 86 | lightness). One hue only, as the app icons have; the suite's full |
| 87 | aurora stays on Home. It is painted on the body so it can reach |
| 88 | the bar and the edges without anything here overflowing. */ |
| 89 | body:has([docs-list]) { |
| 90 | background: |
| 91 | radial-gradient(ellipse 70rem 28rem at 50% -6rem, |
| 92 | light-dark(oklch(0.86 0.06 262 / 0.55), oklch(0.42 0.08 262 / 0.16)), |
| 93 | transparent 70%) |
| 94 | no-repeat, |
| 95 | var(--rst-bg); |
| 96 | } |
| 97 | [docs-list] { |
| 98 | padding-block: var(--rst-sp-4) var(--rst-sp-6); |
| 99 | } |
| 100 | /* The header: the screen's name, large and set tight, with search |
| 101 | and create on the same line. It wraps under the title on a phone, |
| 102 | search first, at full width. */ |
| 103 | [docs-list-head] { |
| 104 | display: flex; |
| 105 | flex-wrap: wrap; |
| 106 | align-items: center; |
| 107 | justify-content: space-between; |
| 108 | gap: var(--rst-sp-3) var(--rst-sp-5); |
| 109 | margin-block-end: var(--rst-sp-5); |
| 110 | } |
| 111 | [docs-list-head] h1 { |
| 112 | margin: 0; |
| 113 | font-size: clamp(1.75rem, 1.3rem + 1.6vw, 2.5rem); |
| 114 | font-weight: 700; |
| 115 | letter-spacing: -0.025em; |
| 116 | line-height: 1.1; |
| 117 | } |
| 118 | /* [docs-header-actions]: search and create as one group. They stay |
| 119 | two separate <form>s, never one, because they are unrelated |
| 120 | actions with different methods and targets (GET / vs POST |
| 121 | /documents) and must never be merged into one submit. */ |
| 122 | [docs-header-actions] { |
| 123 | display: flex; |
| 124 | flex: 1 1 22rem; |
| 125 | justify-content: flex-end; |
| 126 | align-items: center; |
| 127 | gap: var(--rst-sp-3); |
| 128 | min-inline-size: 0; |
| 129 | } |
| 130 | /* Search is one field with its submit inside it, at the start, as the |
| 131 | magnifier. The button keeps "Search documents" as its name, so a |
| 132 | pointer, a screen reader and Enter from the field all reach the |
| 133 | same submit. The field takes whatever the row leaves it, down to |
| 134 | nothing: min-inline-size: 0 lifts a flex item's automatic minimum, |
| 135 | which for an <input> is its content and would otherwise push the |
| 136 | page sideways at 320px (SC 1.4.10, which this app supports with |
| 137 | no exemption; the old two-control form failed it once). */ |
| 138 | [docs-search-form] { |
| 139 | position: relative; |
| 140 | display: flex; |
| 141 | flex: 0 1 20rem; |
| 142 | min-inline-size: 0; |
| 143 | } |
| 144 | [docs-search-form] [rst-input] { |
| 145 | flex: 1 1 auto; |
| 146 | min-inline-size: 0; |
| 147 | min-block-size: 40px; |
| 148 | padding-inline-start: 40px; /* spacing-allow: the magnifier's room, the 38px submit laid over the field's start */ |
| 149 | border-color: transparent; |
| 150 | border-radius: var(--rst-radius-pill); |
| 151 | background: light-dark(rgb(255 255 255 / 0.8), rgb(255 255 255 / 0.06)); |
| 152 | box-shadow: inset 0 0 0 1px var(--rst-line), 0 1px 2px light-dark(rgb(20 30 60 / 0.06), transparent); |
| 153 | } |
| 154 | [docs-search-form] [rst-input]:hover { |
| 155 | box-shadow: inset 0 0 0 1px var(--rst-line-strong); |
| 156 | } |
| 157 | [docs-search-submit] { |
| 158 | position: absolute; |
| 159 | inset-block: 0; |
| 160 | inset-inline-start: 2px; |
| 161 | display: grid; |
| 162 | place-items: center; |
| 163 | inline-size: 38px; |
| 164 | padding: 0; |
| 165 | border: 0; |
| 166 | border-radius: var(--rst-radius-pill); |
| 167 | background: transparent; |
| 168 | color: var(--rst-text-muted); |
| 169 | cursor: pointer; |
| 170 | } |
| 171 | [docs-search-submit]:hover { |
| 172 | color: var(--rst-accent); |
| 173 | } |
| 174 | [docs-search-submit] svg, |
| 175 | [docs-create-form] svg { |
| 176 | inline-size: 18px; |
| 177 | block-size: 18px; |
| 178 | fill: none; |
| 179 | stroke: currentColor; |
| 180 | stroke-width: 2; |
| 181 | stroke-linecap: round; |
| 182 | } |
| 183 | [docs-create-form] { |
| 184 | flex: none; |
| 185 | } |
| 186 | /* Import (from Google Drive or a .docx, import.go) sits beside New |
| 187 | document as the quieter of the two: the same 40px pill, no fill, |
| 188 | the line for an edge. */ |
| 189 | [docs-import-link] { |
| 190 | display: inline-flex; |
| 191 | align-items: center; |
| 192 | flex: none; |
| 193 | min-block-size: 40px; |
| 194 | padding-inline: var(--rst-sp-4); |
| 195 | border-radius: var(--rst-radius-pill); |
| 196 | color: var(--rst-text); |
| 197 | font-weight: 600; |
| 198 | text-decoration: none; |
| 199 | white-space: nowrap; |
| 200 | background: light-dark(rgb(255 255 255 / 0.8), rgb(255 255 255 / 0.06)); |
| 201 | box-shadow: inset 0 0 0 1px var(--rst-line), 0 1px 2px light-dark(rgb(20 30 60 / 0.06), transparent); |
| 202 | } |
| 203 | [docs-import-link]:hover { |
| 204 | box-shadow: inset 0 0 0 1px var(--rst-line-strong); |
| 205 | } |
| 206 | /* A phone: the title and "New document" share the first line, and |
| 207 | search takes the whole second one, where its hint has room to be |
| 208 | read. For a member, Import sits beside it (alone on a line of its |
| 209 | own it read as stray); a guest has neither button, so search keeps |
| 210 | the full line. |
| 211 | display: contents lets the two forms join the header's own row; |
| 212 | they stay two separate forms. The title's box is its line's |
| 213 | height, the button's, so the line under it is one step below the |
| 214 | title as well as below the button (Fiesta's rhythm audit). */ |
| 215 | @media (max-width: 36rem) { |
| 216 | [docs-header-actions] { |
| 217 | display: contents; |
| 218 | } |
| 219 | [docs-list-head] h1 { |
| 220 | display: flex; |
| 221 | align-items: center; |
| 222 | align-self: stretch; |
| 223 | flex: 1 1 auto; |
| 224 | } |
| 225 | [docs-search-form] { |
| 226 | order: 3; |
| 227 | flex: 1 1 100%; |
| 228 | } |
| 229 | [docs-list-head]:has([docs-import-link]) [docs-search-form] { |
| 230 | flex: 1 1 8rem; |
| 231 | } |
| 232 | [docs-import-link] { |
| 233 | order: 4; |
| 234 | } |
| 235 | } |
| 236 | [docs-create-form] button { |
| 237 | display: inline-flex; |
| 238 | align-items: center; |
| 239 | gap: var(--rst-sp-2); |
| 240 | min-block-size: 40px; |
| 241 | padding-inline: var(--rst-sp-4) var(--rst-sp-5); |
| 242 | border-radius: var(--rst-radius-pill); |
| 243 | white-space: nowrap; |
| 244 | box-shadow: 0 1px 0 rgb(255 255 255 / 0.18) inset, 0 6px 16px -6px color-mix(in oklab, var(--rst-accent) 70%, transparent); |
| 245 | } |
| 246 | /* The shelf: the newest documents as their own first pages, one |
| 247 | row of them across the column (recentShelf, handlers.go). On a |
| 248 | phone it is a row you swipe, two and a bit pages wide, so the |
| 249 | list below it is still on the first screen. */ |
| 250 | [docs-shelf] { |
| 251 | display: grid; |
| 252 | grid-template-columns: repeat(5, minmax(0, 1fr)); |
| 253 | gap: var(--rst-sp-5); |
| 254 | margin: 0 0 var(--rst-sp-6); |
| 255 | padding: 0; |
| 256 | list-style: none; |
| 257 | } |
| 258 | @media (max-width: 48rem) { |
| 259 | [docs-shelf] { |
| 260 | grid-template-columns: none; |
| 261 | grid-auto-flow: column; |
| 262 | grid-auto-columns: 40%; |
| 263 | gap: var(--rst-sp-4); |
| 264 | overflow-x: auto; |
| 265 | overscroll-behavior-x: contain; |
| 266 | scroll-snap-type: x mandatory; |
| 267 | scrollbar-width: none; |
| 268 | /* Room for the pages' shadows and their lift inside the |
| 269 | scroller, which clips both. */ |
| 270 | margin-inline: calc(var(--rst-sp-4) * -1); |
| 271 | padding: var(--rst-sp-2) var(--rst-sp-4) var(--rst-sp-4); |
| 272 | scroll-padding-inline: var(--rst-sp-4); |
| 273 | } |
| 274 | [docs-shelf] > li { |
| 275 | scroll-snap-align: start; |
| 276 | } |
| 277 | } |
| 278 | [docs-tile] { |
| 279 | display: flex; |
| 280 | flex-direction: column; |
| 281 | gap: var(--rst-sp-1); |
| 282 | min-inline-size: 0; |
| 283 | color: var(--rst-text); |
| 284 | text-decoration: none; |
| 285 | border-radius: var(--rst-radius-sm); |
| 286 | } |
| 287 | [docs-tile]:focus-visible { |
| 288 | outline: 2px solid var(--rst-accent); |
| 289 | outline-offset: 6px; |
| 290 | } |
| 291 | [docs-tile-title] { |
| 292 | order: 2; |
| 293 | margin-block-start: var(--rst-sp-3); |
| 294 | font-size: var(--rst-fs-sm, 0.875rem); |
| 295 | font-weight: 600; |
| 296 | line-height: 1.3; |
| 297 | overflow-wrap: anywhere; |
| 298 | display: -webkit-box; |
| 299 | -webkit-box-orient: vertical; |
| 300 | -webkit-line-clamp: 2; |
| 301 | line-clamp: 2; |
| 302 | overflow: hidden; |
| 303 | } |
| 304 | [docs-tile-meta] { |
| 305 | order: 3; |
| 306 | display: flex; |
| 307 | flex-wrap: wrap; |
| 308 | gap: 0 var(--rst-sp-2); |
| 309 | color: var(--rst-text-muted); |
| 310 | font-size: var(--rst-fs-xs, 0.75rem); |
| 311 | } |
| 312 | /* [docs-thumb] holds a real rendering of the document's page one: |
| 313 | the <svg> inside it is the line boxes the PDF exporter's own |
| 314 | layout placed, through export.PageOne (see preview.go), in the |
| 315 | page's own coordinates (612 by 792, the viewBox), margins and |
| 316 | all. The paper is the literal white a document always is (spec |
| 317 | §10.2), in either theme. An empty document is the same sheet with |
| 318 | nothing on it. */ |
| 319 | [docs-thumb] { |
| 320 | display: block; |
| 321 | flex: none; |
| 322 | aspect-ratio: 612 / 792; |
| 323 | border-radius: 2px; |
| 324 | background: #ffffff; |
| 325 | overflow: hidden; |
| 326 | box-shadow: |
| 327 | 0 0 0 1px light-dark(rgb(23 32 60 / 0.10), rgb(255 255 255 / 0.08)), |
| 328 | 0 1px 2px rgb(23 32 60 / 0.08); |
| 329 | } |
| 330 | [docs-thumb] > svg { |
| 331 | display: block; |
| 332 | inline-size: 100%; |
| 333 | block-size: 100%; |
| 334 | } |
| 335 | /* The lines of text, in a soft ink. Nothing about the thumbnail |
| 336 | carries meaning by colour: a heading reads as a heading because |
| 337 | its bar is taller, which is the real ratio between the two type |
| 338 | sizes. */ |
| 339 | [docs-thumb] rect { |
| 340 | fill: #b9c0cc; |
| 341 | } |
| 342 | /* On the shelf the page is the tile: full width, lying on the desk. */ |
| 343 | [docs-tile] [docs-thumb] { |
| 344 | order: 1; |
| 345 | inline-size: 100%; |
| 346 | border-radius: 3px; |
| 347 | box-shadow: |
| 348 | 0 0 0 1px light-dark(rgb(23 32 60 / 0.07), rgb(255 255 255 / 0.06)), |
| 349 | 0 1px 2px rgb(23 32 60 / 0.08), |
| 350 | 0 10px 24px -12px light-dark(rgb(23 32 60 / 0.28), rgb(0 0 0 / 0.7)); |
| 351 | } |
| 352 | /* Picking a page up: it lifts toward the reader, a little larger, |
| 353 | and takes the accent's edge, and while |
| 354 | the pointer is over it, it leans a few degrees toward it and a |
| 355 | pool of light follows it across the paper (brand/pointer.js writes |
| 356 | --docs-tx/--docs-ty and --rst-mx/--rst-my; the transform's |
| 357 | transition is what makes the lean follow rather than jump). The |
| 358 | motion answers the pointer, and is dropped for reduced motion, |
| 359 | where the edge alone says the same thing. */ |
| 360 | [docs-tile] [docs-thumb] { |
| 361 | position: relative; |
| 362 | } |
| 363 | [docs-tile] [docs-thumb]::after { |
| 364 | content: ""; |
| 365 | position: absolute; |
| 366 | inset: 0; |
| 367 | background: |
| 368 | var(--docs-flare), |
| 369 | radial-gradient(180px circle at var(--rst-mx, 50%) var(--rst-my, 0%), var(--docs-light-tint), transparent 70%); |
| 370 | opacity: 0; |
| 371 | transition: opacity 200ms ease; |
| 372 | pointer-events: none; |
| 373 | } |
| 374 | [docs-tile]:hover [docs-thumb]::after { |
| 375 | opacity: 1; |
| 376 | } |
| 377 | [docs-tile]:hover [docs-thumb], |
| 378 | [docs-tile]:focus-visible [docs-thumb] { |
| 379 | transform: translateY(-6px) perspective(800px) |
| 380 | rotateX(calc(var(--docs-ty, 0) * -4deg)) |
| 381 | rotateY(calc(var(--docs-tx, 0) * 5deg)) |
| 382 | scale(1.05); |
| 383 | box-shadow: |
| 384 | 0 0 0 1.5px var(--rst-accent), |
| 385 | 0 2px 4px rgb(23 32 60 / 0.08), |
| 386 | 0 18px 32px -14px light-dark(rgb(23 32 60 / 0.35), rgb(0 0 0 / 0.8)); |
| 387 | } |
| 388 | [docs-tile]:hover [docs-tile-title] { |
| 389 | color: var(--rst-accent); |
| 390 | } |
| 391 | /* Pressed, the page gives under the finger and springs back, where |
| 392 | motion is welcome (the scale is in the no-preference rule below). */ |
| 393 | @media (prefers-reduced-motion: no-preference) { |
| 394 | [docs-tile]:active [docs-thumb] { |
| 395 | scale: 0.97; |
| 396 | } |
| 397 | } |
| 398 | [docs-tile] [docs-thumb] { |
| 399 | transition: transform 180ms cubic-bezier(.2, .7, .2, 1), box-shadow 180ms ease, scale 0.42s cubic-bezier(0.3, 1.6, 0.5, 1); |
| 400 | } |
| 401 | [docs-tile]:active [docs-thumb] { |
| 402 | transition: transform 180ms cubic-bezier(.2, .7, .2, 1), box-shadow 180ms ease, scale 90ms ease-out; |
| 403 | } |
| 404 | @media (prefers-reduced-motion: reduce) { |
| 405 | [docs-tile] [docs-thumb] { |
| 406 | transition: none; |
| 407 | } |
| 408 | [docs-tile]:active [docs-thumb] { |
| 409 | transition: none; |
| 410 | } |
| 411 | [docs-tile]:hover [docs-thumb], |
| 412 | [docs-tile]:focus-visible [docs-thumb] { |
| 413 | transform: none; |
| 414 | } |
| 415 | } |
| 416 | /* The rows: everything older than the shelf, grouped by recency |
| 417 | (spec §6.4), and every search result. rastrillo's list and row, |
| 418 | with a small sheet of the page at the start of each. rastrillo |
| 419 | already stretches the title link over the whole row ([rst-row] |
| 420 | position: relative, [rst-row-main] > a::after inset: 0) and tints |
| 421 | it on hover; nothing of ours restates that. */ |
| 422 | [docs-list] [rst-list] { |
| 423 | border-radius: var(--rst-radius); |
| 424 | box-shadow: 0 1px 2px light-dark(rgb(23 32 60 / 0.05), transparent); |
| 425 | } |
| 426 | [docs-list] [rst-row] { |
| 427 | gap: var(--rst-sp-4); |
| 428 | } |
| 429 | /* The row under the pointer: rastrillo's hover tint, with a pool of |
| 430 | the accent's light following the pointer along it. */ |
| 431 | @media (hover: hover) { |
| 432 | [docs-list] [rst-row]:hover { |
| 433 | background-image: var(--docs-flare), radial-gradient(280px circle at var(--rst-mx, 50%) var(--rst-my, 50%), var(--docs-light-tint), transparent 70%); |
| 434 | } |
| 435 | } |
| 436 | /* Big enough to read the page's shape, its headings and paragraphs, |
| 437 | at a glance: 44px is a sheet a person can tell from its |
| 438 | neighbours, where 26px was a bordered box. */ |
| 439 | [rst-row] [docs-thumb] { |
| 440 | inline-size: 44px; |
| 441 | margin-block: 2px; /* spacing-allow: a breath so the sheet's 1px ring never meets the row's edge */ |
| 442 | box-shadow: |
| 443 | 0 0 0 1px light-dark(rgb(23 32 60 / 0.10), rgb(255 255 255 / 0.08)), |
| 444 | 0 1px 2px rgb(23 32 60 / 0.08), |
| 445 | 0 4px 10px -6px rgb(23 32 60 / 0.25); |
| 446 | } |
| 447 | /* A group's heading inside the list: sentence case, the muted ink, |
| 448 | weight doing the work rather than capitals. */ |
| 449 | [docs-group-label] { |
| 450 | margin: 0; |
| 451 | padding: var(--rst-sp-4) var(--rst-sp-4) var(--rst-sp-2); |
| 452 | font-size: var(--rst-fs-sm, 0.875rem); |
| 453 | font-weight: 600; |
| 454 | color: var(--rst-text-muted); |
| 455 | } |
| 456 | /* Title over the document's opening words: the row says what is in |
| 457 | it, not only what it is called. The words are the page's own |
| 458 | (preview.go's excerpt), one line, muted, cut by the stylesheet. */ |
| 459 | [docs-list] [rst-row-main] { |
| 460 | display: flex; |
| 461 | flex-direction: column; |
| 462 | gap: var(--rst-sp-1); |
| 463 | min-inline-size: 0; |
| 464 | } |
| 465 | [docs-row-excerpt] { |
| 466 | overflow: hidden; |
| 467 | color: var(--rst-text-muted); |
| 468 | font-size: var(--rst-fs-sm, 0.875rem); |
| 469 | line-height: 1.4; |
| 470 | white-space: nowrap; |
| 471 | text-overflow: ellipsis; |
| 472 | } |
| 473 | @media (max-width: 36rem) { |
| 474 | [docs-row-excerpt] { |
| 475 | display: -webkit-box; |
| 476 | -webkit-box-orient: vertical; |
| 477 | -webkit-line-clamp: 2; |
| 478 | line-clamp: 2; |
| 479 | white-space: normal; |
| 480 | } |
| 481 | } |
| 482 | [docs-row-when] { |
| 483 | flex: none; |
| 484 | color: var(--rst-text-muted); |
| 485 | font-size: var(--rst-fs-sm); |
| 486 | font-variant-numeric: tabular-nums; |
| 487 | } |
| 488 | /* The way back out of a result page, under the results rather than |
| 489 | in the header: it is about the list being shown, not about the |
| 490 | controls that produced it. */ |
| 491 | [docs-search-clear] { |
| 492 | margin-block-start: var(--rst-sp-6); |
| 493 | font-size: var(--rst-fs-sm); |
| 494 | } |
| 495 | [docs-list] [rst-empty] { |
| 496 | margin-block-start: var(--rst-sp-6); |
| 497 | } |
| 498 | </style> |
| 499 | <div docs-list> |
| 500 | <header docs-list-head> |
| 501 | <h1>{{.Title}}</h1> |
| 502 | <div docs-header-actions> |
| 503 | {{/* Search (spec §15.2's title search). A GET form, so a search |
| 504 | is a link — bookmarkable, reloadable, and reachable with the |
| 505 | back button — and so the whole feature works with no |
| 506 | JavaScript at all. fixtures/jump-to.mjs adds a keyboard |
| 507 | shortcut on top of this; it does not replace it. |
| 508 | |
| 509 | type="search" rather than type="text": it gets the platform's |
| 510 | own clear control and its own keyboard on a phone. The value |
| 511 | is echoed back so a result page can be edited and |
| 512 | re-submitted rather than retyped. */}} |
| 513 | {{/* data-busy="false": a search shows something rather than |
| 514 | changing anything, so the busy rule's spinner and its 650ms hold |
| 515 | on the submit (estilo busy.js) would only delay the results. */}} |
| 516 | <form docs-search-form method="get" action="/" role="search" data-busy="false"> |
| 517 | <input rst-input docs-search-input type="search" name="q" value="{{.Query}}" |
| 518 | placeholder="{{.SearchPlace}}" aria-label="{{.SearchLabel}}" autocomplete="off"> |
| 519 | <button docs-search-submit type="submit" title="{{.SearchLabel}}" aria-label="{{.SearchLabel}}"><svg viewBox="0 0 20 20" aria-hidden="true" focusable="false"><circle cx="8.5" cy="8.5" r="5.5"/><path d="m13 13 4 4"/></svg></button> |
| 520 | </form> |
| 521 | {{if .CanCreate}} <form docs-create-form method="post" action="/documents"> |
| 522 | <button rst-btn="primary" type="submit"><svg viewBox="0 0 20 20" aria-hidden="true" focusable="false"><path d="M10 4v12M4 10h12"/></svg>{{.CreateLabel}}</button> |
| 523 | </form> |
| 524 | <a docs-import-link href="/import">{{.ImportLabel}}</a>{{end}} |
| 525 | </div> |
| 526 | </header> |
| 527 | {{if .PartialCatalog}}{{template "callout" (dict "Body" .PartialCatalog "Tone" "warning")}}{{end}} |
| 528 | {{/* Searching renders a ranked, UNGROUPED list of rows. Recency |
| 529 | grouping is what an unfiltered list is for; grouping ranked |
| 530 | results under "Today" and "Earlier" would order the same rows |
| 531 | twice by two different rules and show only the second. And a |
| 532 | result is found by its title, so the shelf of pages, which is |
| 533 | about what was worked on last, has no place here. */}} |
| 534 | {{if .Searching}} |
| 535 | {{if .Results}} |
| 536 | <div rst-list> |
| 537 | {{range .Results}}{{template "row" .}}{{end}} |
| 538 | </div> |
| 539 | {{else}} |
| 540 | <div rst-empty> |
| 541 | <h2 rst-empty-title>{{.NoResultsHead}}</h2> |
| 542 | <p rst-empty-body>{{.NoResultsBody}}</p> |
| 543 | </div> |
| 544 | {{end}} |
| 545 | <p docs-search-clear><a href="/">{{.ClearLabel}}</a></p> |
| 546 | {{else if or .Recent .Groups}} |
| 547 | {{if .Recent}}<ul docs-shelf> |
| 548 | {{range .Recent}}{{template "tile" .}}{{end}} |
| 549 | </ul>{{end}} |
| 550 | {{if .Groups}}<div rst-list> |
| 551 | {{range .Groups}} |
| 552 | <h2 docs-group-label>{{.Label}}</h2> |
| 553 | {{range .Rows}}{{template "row" .}}{{end}} |
| 554 | {{end}} |
| 555 | </div>{{end}} |
| 556 | {{else}} |
| 557 | <div rst-empty> |
| 558 | <h2 rst-empty-title>{{.EmptyTitle}}</h2> |
| 559 | <p rst-empty-body>{{.EmptyBody}}</p> |
| 560 | </div> |
| 561 | {{end}} |
| 562 | </div> |
| 563 | {{template "docs-jumpto" .}} |
| 564 | <script defer src="{{asset "static/brand/list.js"}}"></script> |
| 565 | {{end}} |
| 566 | |