all repos

mugit @ c8261120f46661cba86861f09889fea875ee4395

🐮 git server that your cow will love

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

Oleksandr Smirnov Oleksandr Smirnov
olexsmir@gmail.com
support custom ssh user name (for future switch to ssh), 3 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
            Last updated {{ humanizeRelTime .P.MirrorLastSync }} from:
44
            <a href="{{.P.MirrorURL}}" target="_blank">{{.P.MirrorURL}}</a>
45
          </p>
46
          {{- end}}
47
        </div>
48
      </section>
49
      {{ end }}
50
51
      {{- if .P.Readme }}
52
      <article class="readme">{{- .P.Readme -}}</article>
53
      {{- end -}}
54
    </main>
55
  </body>
56
</html>
57
{{ end }}