all repos

mugit @ bb41a2de0ea7685cefbe3e40f5729be0c8037c6f

🐮 git server that your cow will love

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

Oleksandr Smirnov Oleksandr Smirnov
olexsmir@gmail.com
ui: if repo is empty, and wasn't synced yet, how the mirroring source, 2 months ago
1
{{ define "repo_index" }}
2
<!DOCTYPE html>
3
<html>
4
  <head>
5
    {{ template "head" . }}
6
    <title>{{ .RepoName}} &mdash; {{ .Meta.Title }}</title>
7
  </head>
8
  <body>
9
    {{ template "repo_header" . }}
10
    <main>
11
      {{ if .P.IsEmpty }}
12
      <h3>Repository is empty</h3>
13
      {{ if .P.IsMirror }}
14
      <p>
15
        Awaiting initial sync from:
16
        <a class="link" href="{{.P.MirrorURL}}" target="_blank">{{.P.MirrorURL}}</a>
17
      </p>
18
      {{ end }}
19
      {{ else }}
20
      <section class="repo-index">
21
        <div class="repo-index-main">
22
          {{ $repo := .RepoName }}
23
          {{ range .P.Commits }}
24
          <div class="box">
25
            <div>
26
              <a href="/{{ $repo }}/commit/{{ .Hash }}" class="commit-hash link">{{ .HashShort }}</a>
27
              &mdash; {{ .AuthorName }}
28
              <span class="commit-date commit-info has-tip">
29
                {{ .Committed.Format "Mon, 02 Jan 2006" }}
30
                <span class="tooltip" role="tooltip">{{ humanizeTime .Committed }}</span>
31
              </span>
32
            </div>
33
            <div>
34
              {{- if .Message }}{{- commitSummary .Message -}}
35
              {{- else -}}<span class="muted">Empty message</span>{{- end -}}
36
            </div>
37
          </div>
38
          {{ end }}
39
        </div>
40
41
        <div class="repo-index-side">
42
          <h2>Clone urls</h2>
43
          <pre>https://{{.Meta.Host}}/{{.RepoName}}</pre>
44
          {{ if .Meta.SSHEnabled }}<pre>{{.P.SSHUser}}@{{.Meta.Host}}:{{.RepoName}}</pre>{{end}}
45
          {{ if .P.IsMirror }}
46
          <br>
47
          <h2>Mirror status</h2>
48
          <p>
49
            {{ if .P.MirrorLastSync.IsZero }}Was not yet synced from:
50
            {{ else }}Last updated {{ humanizeRelTime .P.MirrorLastSync }} from:
51
            {{ end }}
52
            <a href="{{.P.MirrorURL}}" target="_blank">{{.P.MirrorURL}}</a>
53
          </p>
54
          {{ end }}
55
        </div>
56
      </section>
57
58
      {{ if .P.Readme }}<article class="readme">{{.P.Readme}}</article>{{ end }}
59
      {{ end }}
60
    </main>
61
  </body>
62
</html>
63
{{ end }}