all repos

mugit @ da15464

🐮 git server that your cow will love

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

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