all repos

mugit @ 8fee104

🐮 git server that your cow will love

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

Oleksandr Smirnov Oleksandr Smirnov
olexsmir@gmail.com
ui: improve ux of commits with empty message, 3 months ago
1
{{ define "repo_index" }}
2
<!DOCTYPE html>
3
<html>
4
  <head>
5
    {{ template "head" . }}
6
    <title>{{ .name }} &mdash; {{ .meta.Title }}</title>
7
  </head>
8
  <body>
9
    {{ template "repo_header" . }}
10
    <main>
11
      {{ $repo := .name }}
12
      {{ if .empty }}
13
      <h3>Repository is empty</h3>
14
      {{ else }}
15
      <section class="repo-index">
16
        <div class="repo-index-main">
17
          {{ range .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">{{ .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>{{- /* */ -}}
38
https://{{ .servername }}/{{ .name }}
39
git@{{ .servername }}:{{ .name }}
40
{{- /* */ -}}</pre>
41
42
          {{- if .mirrorinfo.isMirror }}
43
          <br>
44
          <h2>Mirror Status</h3>
45
            <p>
46
              Last updated {{ humanizeTime .mirrorinfo.lastSync }} from:
47
              <a href="{{ .mirrorinfo.url }}" target="_blank">{{ .mirrorinfo.url }}</a>
48
            </p>
49
            {{- end }}
50
        </div>
51
      </section>
52
      {{ end }}
53
54
      {{- if .readme }}
55
      <article class="readme">
56
        {{- .readme -}}
57
      </article>
58
      {{- end -}}
59
    </main>
60
  </body>
61
</html>
62
{{ end }}