~bigbes/sr-ht-compare

ref: 05a6bcb619654504eb8290afde47486d1ec61363 sr-ht-compare/web/templates/commit.html -rw-r--r-- 2.8 KiB
05a6bcb6 — bigbes readme: name the ecore packages the web tier draws from 10 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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
{{define "content"}}
{{$owner := .Data.Owner}}
{{$repo := .Data.RepoName}}
{{$c := .Data.Commit}}
<div class="row">
  <div class="col-md-12">
    <h2>
      <a href="/~{{$owner}}/{{$repo}}">~{{$owner}}/{{$repo}}</a>:
      <code>{{$c.ShortSHA}}</code>
    </h2>
    <p><strong>{{$c.Subject}}</strong></p>
    {{if $c.Body}}<pre class="commit-body">{{$c.Body}}</pre>{{end}}
    <p class="text-muted">
      {{$c.AuthorName}} &lt;{{$c.AuthorEmail}}&gt;{{abstime $c.Date}}
    </p>
    <p class="text-muted">
      Commit <code>{{$c.SHA}}</code><a href="{{.Data.PatchURL}}">view raw patch</a>
    </p>
    {{if $c.ParentSHAs}}
    <p>
      Parent(s):
      {{range $c.ParentSHAs}}
      <a href="/~{{$owner}}/{{$repo}}/commit/{{.}}"><code>{{shortsha .}}</code></a>
      {{end}}
    </p>
    {{end}}
  </div>
</div>

{{if .Data.IsMerge}}
<div class="alert alert-info">
  This is a merge commit; the diff shown is against its first parent.
</div>
{{end}}

{{if .Data.Truncated}}
<div class="alert alert-warning compare-truncated">
  This diff is too large to render in full.
  <a href="{{.Data.PatchURL}}">Download the raw patch</a> to see everything.
</div>
{{end}}

<div class="row">
  <div class="col-md-12">
    <h3>{{len .Data.Files}} changed file(s)</h3>
    <table class="table">
      <thead>
        <tr><th>File</th><th>Status</th><th>+</th><th>&minus;</th></tr>
      </thead>
      <tbody>
        {{range .Data.Files}}
        <tr>
          <td>
            {{if and .OldPath (ne .OldPath .Path)}}<code>{{.OldPath}}</code>{{end}}<code>{{.Path}}</code>
            {{if .Binary}}<span class="badge badge-secondary">BIN</span>{{end}}
          </td>
          <td><span class="diff-status diff-status-{{statusClass .Status}}" title="{{statusLabel .Status}}">{{.Status}}</span></td>
          <td class="text-success">{{if .Additions}}+{{.Additions}}{{end}}</td>
          <td class="text-danger">{{if .Deletions}}-{{.Deletions}}{{end}}</td>
        </tr>
        {{end}}
      </tbody>
    </table>
  </div>
</div>

<div class="diff-layout-toggle">
  <button type="button" data-diff-layout="split">Split</button>
  <button type="button" data-diff-layout="stacked">Unified</button>
  <button type="button" data-diff-wrap aria-pressed="false">Wrap long lines</button>
</div>
<div id="compare-app">
  <div id="tree-root"></div>
  <div id="diff-root"></div>
</div>
<script id="compare-data" type="application/json">{{.Data.JSON}}</script>
{{end}}

{{/* The bundle's href comes from the chrome's Assets, and is guarded on
     emptiness for the reason StyleHref is: a build without the artefact must
     render a page that says so by being inert, not a <script src=""> that
     re-requests the document it is in. */}}
{{define "scripts"}}
{{with index .Assets "bundle.js"}}<script type="module" src="{{.}}"></script>{{end}}
{{end}}