all repos

mugit @ 9d3f4dd

🐮 git server that your cow will love

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

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
{{ define "repo_index" }}
<!DOCTYPE html>
<html>
  <head>
    {{ template "head" . }}
    <title>{{ .RepoName}} &mdash; {{ .Meta.Title }}</title>
  </head>
  <body>
    {{ template "repo_header" . }}
    <main>
      {{ if .P.IsEmpty }}
      <h3>Repository is empty</h3>
      {{ else }}
      <section class="repo-index">
        <div class="repo-index-main">
          {{ $repo := .RepoName }}
          {{ range .P.Commits }}
          <div class="box">
            <div>
              <a href="/{{ $repo }}/commit/{{ .Hash }}" class="commit-hash link">{{ .HashShort }}</a>
              &mdash; {{ .AuthorName }}
              <span class="commit-date commit-info age">
                {{ .Committed.Format "Mon, 02 Jan 2006" }}
                <span class="tooltip" role="tooltip">{{ humanizeTime .Committed }}</span>
              </span>
            </div>
            <div>
              {{- if .Message }}{{- commitSummary .Message -}}
              {{- else -}}<span class="muted">Empty message</span>{{- end -}}
            </div>
          </div>
          {{ end }}
        </div>

        <div class="repo-index-side">
          <h2>Clone urls</h2>
          <pre>https://{{.Meta.Host}}/{{.RepoName}}</pre>
          {{ if .Meta.SSHEnabled }}<pre>git@{{.Meta.Host}}:{{.RepoName}}</pre>{{end}}
          {{- if .P.IsMirror -}}
          <br>
          <h2>Mirror status</h2>
          <p>
            Last updated {{ humanizeRelTime .P.MirrorLastSync }} from:
            <a href="{{.P.MirrorURL}}" target="_blank">{{.P.MirrorURL}}</a>
          </p>
          {{- end}}
        </div>
      </section>
      {{ end }}

      {{- if .P.Readme }}
      <article class="readme">{{- .P.Readme -}}</article>
      {{- end -}}
    </main>
  </body>
</html>
{{ end }}