all repos

mugit @ be1cdfd

🐮 git server that your cow will love

mugit/web/templates/repo_compare.html (view raw)

Oleksandr Smirnov Oleksandr Smirnov
olexsmir@gmail.com
feat: compare refs (#9)..., 1 month ago
1
{{ define "repo_compare" }}
2
{{ $cmp := .P.Compare }}
3
{{ $diff := $cmp.Diff.Diff }}
4
<html>
5
  <head>
6
    {{ template "head" . }}
7
    <title>{{ $.RepoName }}: compare {{ $cmp.BaseRef }}...{{ $cmp.HeadRef }}</title>
8
  </head>
9
  <body>
10
    {{ template "repo_header" . }}
11
    <main>
12
      <section class="commit">
13
        <div class="commit-refs">
14
          <strong>{{ $cmp.BaseRef }}</strong>...<strong>{{ $cmp.HeadRef }}</strong>
15
          <span class="pl">
16
            <span class="diff-add">{{ $cmp.Ahead }} ahead</span>,
17
            <span class="diff-del">{{ $cmp.Behind }} behind</span>
18
          </span>
19
        </div>
20
        <div class="box">
21
          <span>
22
            <strong>Merge base:</strong>
23
            <a class="link" href="/{{ $.RepoName }}/commit/{{ $cmp.MergeBase }}">{{ printf "%.7s" $cmp.MergeBase }}</a>,
24
          </span>
25
          <span>
26
            <strong>Base:</strong>
27
            <a class="link" href="/{{ $.RepoName }}/commit/{{ $cmp.BaseHash }}">{{ printf "%.7s" $cmp.BaseHash }}</a>,
28
          </span>
29
          <span>
30
            <strong>Head:</strong>
31
            <a class="link" href="/{{ $.RepoName }}/commit/{{ $cmp.HeadHash }}">{{ printf "%.7s" $cmp.HeadHash }}</a>
32
          </span>
33
        </div>
34
      </section>
35
36
      <section class="commit">
37
        <h3>Commits in {{ $cmp.HeadRef }} not in {{ $cmp.BaseRef }}</h3>
38
        {{ template "_diff_stat" $cmp.Diff.Stat }}
39
        {{ if $cmp.Commits }}{{ template "_commit_table" (dict "Repo" $.RepoName "Commits" $cmp.Commits) }}
40
        {{ else }}<p class="muted">No commits to compare.</p>{{ end }}
41
      </section>
42
43
      <section class="commit">{{ template "_diff_table" $diff }}</section>
44
      <section>
45
        {{ template "_diff_files" (dict "Repo" $.RepoName "Diff" $diff "RightHash" $cmp.HeadHash "LeftHash" $cmp.MergeBase) }}
46
      </section>
47
    </main>
48
  </body>
49
</html>
50
{{ end }}