all repos

mugit @ d4f69f4f508a8d4fd6e87585912b53a6bd2aea17

🐮 git server that your cow will love

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

Oleksandr Smirnov Oleksandr Smirnov
olexsmir@gmail.com
ui: show if repo wasn't yet synced, 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
      {{ else }}
14
      <section class="repo-index">
15
        <div class="repo-index-main">
16
          {{ $repo := .RepoName }}
17
          {{ range .P.Commits }}
18
          <div class="box">
19
            <div>
20
              <a href="/{{ $repo }}/commit/{{ .Hash }}" class="commit-hash link">{{ .HashShort }}</a>
21
              &mdash; {{ .AuthorName }}
22
              <span class="commit-date commit-info age">
23
                {{ .Committed.Format "Mon, 02 Jan 2006" }}
24
                <span class="tooltip" role="tooltip">{{ humanizeTime .Committed }}</span>
25
              </span>
26
            </div>
27
            <div>
28
              {{- if .Message }}{{- commitSummary .Message -}}
29
              {{- else -}}<span class="muted">Empty message</span>{{- end -}}
30
            </div>
31
          </div>
32
          {{ end }}
33
        </div>
34
35
        <div class="repo-index-side">
36
          <h2>Clone urls</h2>
37
          <pre>https://{{.Meta.Host}}/{{.RepoName}}</pre>
38
          {{ if .Meta.SSHEnabled }}<pre>{{.P.SSHUser}}@{{.Meta.Host}}:{{.RepoName}}</pre>{{end}}
39
          {{ if .P.IsMirror }}
40
          <br>
41
          <h2>Mirror status</h2>
42
          <p>
43
            {{ if .P.MirrorLastSync.IsZero }}Was not yet synced from:
44
            {{ else }}Last updated {{ humanizeRelTime .P.MirrorLastSync }} from:
45
            {{ end }}
46
            <a href="{{.P.MirrorURL}}" target="_blank">{{.P.MirrorURL}}</a>
47
          </p>
48
          {{ end }}
49
        </div>
50
      </section>
51
52
      {{ if .P.Readme }}<article class="readme">{{.P.Readme}}</article>{{ end }}
53
      {{ end }}
54
    </main>
55
  </body>
56
</html>
57
{{ end }}