~bigbes/sr-ht-compare

ref: 1a83202b75c069e1968095f6f820af989cd2acb6 sr-ht-compare/web/templates/layout.html -rw-r--r-- 2.6 KiB
1a83202b — bigbes deps: sr-ht-ecore with the web-tier packages 9 days ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
{{/*
  The SourceHut chrome. The brand, the service switcher, the login block and the
  environment banner are NOT rendered here: they come from sr-ht-ecore's shared
  partials ("srht-env-banner", "srht-nav"), which every custom service on the
  instance draws from one copy. The dot is this package's viewData, which embeds
  chrome.Page, so the fields those partials read promote into it.

  What is left here is the document, the diff-status colours below (compare's
  own, and nobody else's), and three seams: "head" and "scripts" are blocks, so
  a page that needs neither still renders; "content" is a {{template}} and must
  stay one — a block would give every page an empty default, which is the chrome
  around a hole served 200 for the page that forgot to define it.
*/}}
<!doctype html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>{{.Title}}</title>
    <link rel="icon" type="image/svg+xml" href="/static/logo.svg">
    {{/* Guarded rather than emitted empty: <link href=""> re-requests the page
         it is on, which is a page load per page load. New refuses to start
         without a stylesheet, so in a deployed binary this is always taken. */}}
    {{if .StyleHref}}<link rel="stylesheet" href="{{.StyleHref}}">{{end}}
    <style>
      /* Semantic status badge for the changed-files table. The default table
         cell colour is too dim on the dark chrome, so each git status gets an
         intentional, legible colour in both light and dark schemes. */
      .diff-status {
        display: inline-block;
        min-width: 1.6rem;
        padding: 0 0.4rem;
        border: 1px solid currentColor;
        border-radius: 3px;
        font-size: 0.75rem;
        font-weight: 700;
        line-height: 1.5;
        text-align: center;
      }
      .diff-status-a { color: #1a7f37; }
      .diff-status-m { color: #9a6700; }
      .diff-status-d { color: #cf222e; }
      .diff-status-r { color: #0969da; }
      .diff-status-o { color: #6e7781; }
      @media (prefers-color-scheme: dark) {
        .diff-status-a { color: #3fb950; }
        .diff-status-m { color: #d29922; }
        .diff-status-d { color: #f85149; }
        .diff-status-r { color: #58a6ff; }
        .diff-status-o { color: #8b949e; }
      }
    </style>
    {{block "head" .}}{{end}}
  </head>
  <body>
    {{template "srht-env-banner" .}}
    <nav class="container navbar navbar-light navbar-expand-sm">
      {{template "srht-nav" .}}
    </nav>
    <div class="{{.ContainerClass}}">
      {{template "content" .}}
    </div>
    {{block "scripts" .}}{{end}}
  </body>
</html>