all repos — legit @ 7d99afc5cd3ddfc7a875754f4593812b8c2664c8

web frontend for git, written in go

templates/repo.html (view raw)

 1{{ define "repo" }}
 2<html>
 3{{ template "head" . }}
 4
 5  <header>
 6    <h1>{{ .meta.Title }}</h1>
 7    <h2>{{ .meta.Description }}</h2>
 8  </header>
 9  <body>
10    {{ template "nav" . }}
11    <main>
12      {{ $repo := .name }}
13      {{ $ref := .ref }}
14      {{ $parent := .parent }}
15
16      <table>
17        <tr>
18          <td></td>
19          <td><a href="../">..</a>
20        </tr>
21      {{ range .files }}
22        {{ if .IsFile }}
23        <tr>
24          <td><code>{{ .Mode }}</code></td>
25          <td>
26          {{ if $parent }}
27          <a href="/{{ $repo }}/blob/{{ $ref }}/{{ $parent }}/{{ .Name }}">{{ .Name }}</a>
28          {{ else }}
29          <a href="/{{ $repo }}/blob/{{ $ref }}/{{ .Name }}">{{ .Name }}</a>
30          {{ end }}
31          </td>
32        </tr>
33        {{ else }}
34        <tr>
35          <td><code>{{ .Mode }}</code></td>
36          <td>
37          {{ if $parent }}
38          <a href="/{{ $repo }}/tree/{{ $ref }}/{{ $parent }}/{{ .Name }}">{{ .Name }}/</a>
39          {{ else }}
40          <a href="{{ $repo }}/tree/{{ $ref }}/{{ .Name }}">{{ .Name }}/</a>
41          {{ end }}
42          </td>
43        </tr>
44        {{ end }}
45      {{ end }}
46      </table>
47      <article>
48        <pre>
49          {{- if .readme }}{{ .readme }}{{- end -}}
50        </pre>
51      </article>
52    </main>
53  </body>
54</html>
55{{ end }}