all repos — legit @ c165c447685d68c2b0b2293a31937a903394f943

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    </main>
48  </body>
49</html>
50{{ end }}