diff options
author | Anirudh Oppiliappan <x@icyphox.sh> | 2022-12-18 10:42:18 +0530 |
---|---|---|
committer | Anirudh Oppiliappan <x@icyphox.sh> | 2022-12-18 10:42:18 +0530 |
commit | e4d12fc667c9830dd5f08f827b2a70adff58a09b (patch) | |
tree | c052c87caf09ddc785c1a86454aeee00dcfcf774 /templates | |
parent | 3e6a720154b70a9882af14399548e494b1d0089f (diff) | |
download | legit-e4d12fc667c9830dd5f08f827b2a70adff58a09b.tar.gz legit-e4d12fc667c9830dd5f08f827b2a70adff58a09b.tar.bz2 legit-e4d12fc667c9830dd5f08f827b2a70adff58a09b.zip |
templates: unified repo-header
Diffstat (limited to 'templates')
-rw-r--r-- | templates/commit.html | 7 | ||||
-rw-r--r-- | templates/file.html | 25 | ||||
-rw-r--r-- | templates/log.html | 5 | ||||
-rw-r--r-- | templates/refs.html | 27 | ||||
-rw-r--r-- | templates/repo-header.html | 12 | ||||
-rw-r--r-- | templates/repo.html | 9 | ||||
-rw-r--r-- | templates/tree.html | 5 |
7 files changed, 49 insertions, 41 deletions
diff --git a/templates/commit.html b/templates/commit.html index b4061aa..9ab945a 100644 --- a/templates/commit.html +++ b/templates/commit.html @@ -2,10 +2,7 @@ <html> {{ template "head" . }} - <header> - <h1>{{ .meta.Title }}</h1> - <h2>{{ .meta.Description }}</h2> - </header> + {{ template "repoheader" . }} <body> {{ template "nav" . }} <main> @@ -19,9 +16,11 @@ {{ .commit.This }} </a> </p> + {{ if .commit.Parent }} <p>parent: <a href="/{{ .name }}/commit/{{ .commit.Parent }}"> {{ .commit.Parent }} </a> + {{ end }} </p> <div class="diff-stat"> <div> diff --git a/templates/file.html b/templates/file.html index ed658e3..4d606cc 100644 --- a/templates/file.html +++ b/templates/file.html @@ -2,21 +2,22 @@ <html> {{ template "head" . }} - <header> - <h1>{{ .meta.Title }}</h1> - <h2>{{ .meta.Description }}</h2> - </header> + {{ template "repoheader" . }} <body> {{ template "nav" . }} <main> - <pre> -{{ range .linecount }} -<a id="#L{{ . }}" href="#{{ . }}">{{ . }}</a> -{{- end -}} - </pre> - <pre> -{{ .content }} - </pre> + <div class="file-wrapper"> + <div class="line-numbers"> + {{- range .linecount }} +<a id="L{{ . }}" href="#L{{ . }}">{{ . }}</a> + {{- end -}} + </div> + <div> + <span></span> + <pre> + {{- .content -}} + </pre> + </div> </main> </body> </html> diff --git a/templates/log.html b/templates/log.html index 4a0292c..f5956be 100644 --- a/templates/log.html +++ b/templates/log.html @@ -2,10 +2,7 @@ <html> {{ template "head" . }} - <header> - <h1>{{ .meta.Title }}</h1> - <h2>{{ .meta.Description }}</h2> - </header> + {{ template "repoheader" . }} <body> {{ template "nav" . }} <main> diff --git a/templates/refs.html b/templates/refs.html index aee4a11..5320a8e 100644 --- a/templates/refs.html +++ b/templates/refs.html @@ -2,32 +2,39 @@ <html> {{ template "head" . }} - <header> - <h1>{{ .meta.Title }}</h1> - <h2>{{ .meta.Description }}</h2> - </header> + {{ template "repoheader" . }} <body> {{ template "nav" . }} <main> - <h3>branches</h3> {{ $name := .name }} + <h3>branches</h3> + <div class="refs"> {{ range .branches }} - <p> - <strong>{{ .Name.Short }}</strong> - <a href="/{{ $name }}/tree/{{ .Name.Short }}/">browse</a> - <a href="/{{ $name }}/log/{{ .Name.Short }}">log</a> - </p> + <div> + <strong>{{ .Name.Short }}</strong> + </div> + <div> + <a href="/{{ $name }}/tree/{{ .Name.Short }}/">browse</a> + <a href="/{{ $name }}/log/{{ .Name.Short }}">log</a> + </div> {{ end }} + </div> {{ if .tags }} <h3>tags</h3> + <div class="refs"> {{ range .tags }} + <div> <strong>{{ .Name }}</strong> + </div> + <div> <a href="/{{ $name }}/tree/{{ .Name }}/">browse</a> <a href="/{{ $name }}/log/{{ .Name }}">log</a> {{ if .Message }} <pre>{{ .Message }}</pre> + </div> {{ end }} {{ end }} + </div> {{ end }} </main> </body> diff --git a/templates/repo-header.html b/templates/repo-header.html new file mode 100644 index 0000000..dd84875 --- /dev/null +++ b/templates/repo-header.html @@ -0,0 +1,12 @@ +{{ define "repoheader" }} +<header> + <h2> + <a href="/">all repos</a> + — {{ .name }} + {{ if .ref }} + <span class="ref">@ {{ .ref }}</span> + {{ end }} + </h2> + <h3 class="desc">{{ .desc }}</h3> +</header> +{{ end }} diff --git a/templates/repo.html b/templates/repo.html index 3b5d2b0..2e87b07 100644 --- a/templates/repo.html +++ b/templates/repo.html @@ -7,13 +7,8 @@ </title> {{ template "head" . }} - <header> - <h2> - <a href="/">all repos</a> - — {{ .name }} - </h2> - <h3 class="desc">{{ .desc }}</h3> - </header> +{{ template "repoheader" . }} + <body> {{ template "nav" . }} <main> diff --git a/templates/tree.html b/templates/tree.html index b63a23e..2880714 100644 --- a/templates/tree.html +++ b/templates/tree.html @@ -7,10 +7,7 @@ </title> {{ template "head" . }} - <header> - <h1>{{ .meta.Title }}</h1> - <h2>{{ .meta.Description }}</h2> - </header> + {{ template "repoheader" . }} <body> {{ template "nav" . }} <main> |