diff options
author | Anirudh Oppiliappan <x@icyphox.sh> | 2022-12-17 21:33:04 +0530 |
---|---|---|
committer | Anirudh Oppiliappan <x@icyphox.sh> | 2022-12-17 21:33:04 +0530 |
commit | 5091695e75b2db30b8926d8aa17164c84031bc77 (patch) | |
tree | 40cd73e213e935634229fdadb701badd939846fd /templates | |
parent | 4eaaf451295ce9b541769d1322543f2d982ef5b0 (diff) | |
download | legit-5091695e75b2db30b8926d8aa17164c84031bc77.tar.gz legit-5091695e75b2db30b8926d8aa17164c84031bc77.tar.bz2 legit-5091695e75b2db30b8926d8aa17164c84031bc77.zip |
templates: repo and log
Diffstat (limited to '')
-rw-r--r-- | templates/index.html | 2 | ||||
-rw-r--r-- | templates/log.html | 18 | ||||
-rw-r--r-- | templates/nav.html | 3 | ||||
-rw-r--r-- | templates/repo.html | 56 | ||||
-rw-r--r-- | templates/tree.html | 53 |
5 files changed, 86 insertions, 46 deletions
diff --git a/templates/index.html b/templates/index.html index 02c62ef..25cedfb 100644 --- a/templates/index.html +++ b/templates/index.html @@ -16,7 +16,7 @@ <div class="index"> {{ range .info }} <div><a href="/{{ .Name }}">{{ .Name }}</a></div> - <div>{{ .Desc }}</div> + <div class="desc">{{ .Desc }}</div> <div>{{ .Idle }}</div> {{ end }} </div> diff --git a/templates/log.html b/templates/log.html index de7b200..c4ee9c3 100644 --- a/templates/log.html +++ b/templates/log.html @@ -9,13 +9,17 @@ <body> {{ template "nav" . }} <main> - {{ $repo := .name }} - {{ range .commits }} - <p><a href="/{{ $repo }}/commit/{{ .Hash.String }}">{{ slice .Hash.String 0 8 }}<a> - — {{ .Author.Name }} - <span title="{{ .Author.When }}">{{ .Author.When.Format "Mon, 02 Jan 2006 15:04:05 -0700" }}</span></p> - <p><pre>{{ .Message }}</pre></p> - {{ end }} + {{ $repo := .repo }} + <div class="log"> + {{ range .commits }} + <div> + <div><a href="/{{ $repo }}/commit/{{ .Hash.String }}">{{ slice .Hash.String 0 8 }}</a></div> + <div>{{ .Author.When.Format "Mon, 02 Jan 2006 15:04:05 -0700" }}</div> + <pre>{{ .Message }}</pre> + </div> + <div class="commit-info">{{ .Author.Name }} <span style="color: var(--gray);">{{ .Author.Email }}</span></div> + {{ end }} + </div> </main> </body> </html> diff --git a/templates/nav.html b/templates/nav.html index d0d384d..51c9a34 100644 --- a/templates/nav.html +++ b/templates/nav.html @@ -1,9 +1,8 @@ {{ define "nav" }} <nav> <ul> - <li><a href="/">all repos</a> {{ if .name }} - <li><a href="/{{ .name }}">{{ .name }}</a> + <li><a href="/{{ .name }}">summary</a> <li><a href="/{{ .name }}/refs">refs</a> {{ if .ref }} <li><a href="/{{ .name }}/tree/{{ .ref }}/">tree</a> diff --git a/templates/repo.html b/templates/repo.html index ddc3f01..d4e3e46 100644 --- a/templates/repo.html +++ b/templates/repo.html @@ -1,50 +1,34 @@ {{ define "repo" }} <html> + <title>{{ .name }} + {{ if .parent }} + — {{ .parent }} + {{ end }} + </title> {{ template "head" . }} <header> - <h1>{{ .meta.Title }}</h1> - <h2>{{ .meta.Description }}</h2> + <h2> + <a href="/">all repos</a> + — {{ .name }} + </h2> + <h3 class="desc">{{ .desc }}</h3> </header> <body> {{ template "nav" . }} <main> {{ $repo := .name }} - {{ $ref := .ref }} - {{ $parent := .parent }} - - <table> - <tr> - <td></td> - <td><a href="../">..</a> - </tr> - {{ range .files }} - {{ if .IsFile }} - <tr> - <td><code>{{ .Mode }}</code></td> - <td> - {{ if $parent }} - <a href="/{{ $repo }}/blob/{{ $ref }}/{{ $parent }}/{{ .Name }}">{{ .Name }}</a> - {{ else }} - <a href="/{{ $repo }}/blob/{{ $ref }}/{{ .Name }}">{{ .Name }}</a> - {{ end }} - </td> - </tr> - {{ else }} - <tr> - <td><code>{{ .Mode }}</code></td> - <td> - {{ if $parent }} - <a href="/{{ $repo }}/tree/{{ $ref }}/{{ $parent }}/{{ .Name }}">{{ .Name }}/</a> - {{ else }} - <a href="/{{ $repo }}/tree/{{ $ref }}/{{ .Name }}">{{ .Name }}/</a> - {{ end }} - </td> - </tr> + <div class="log"> + {{ range .commits }} + <div> + <div><a href="/{{ $repo }}/commit/{{ .Hash.String }}">{{ slice .Hash.String 0 8 }}</a></div> + <div>{{ .Author.When.Format "Mon, 02 Jan 2006 15:04:05 -0700" }}</div> + <pre>{{ .Message }}</pre> + </div> + <div class="commit-info">{{ .Author.Name }} <span style="color: var(--gray);">{{ .Author.Email }}</span></div> {{ end }} - {{ end }} - </table> - <article> + </div> + <article class="readme"> <pre> {{- if .readme }}{{ .readme }}{{- end -}} </pre> diff --git a/templates/tree.html b/templates/tree.html new file mode 100644 index 0000000..b63a23e --- /dev/null +++ b/templates/tree.html @@ -0,0 +1,53 @@ +{{ define "tree" }} +<html> + <title>{{ .name }} + {{ if .parent }} + — {{ .parent }} + {{ end }} + </title> +{{ template "head" . }} + + <header> + <h1>{{ .meta.Title }}</h1> + <h2>{{ .meta.Description }}</h2> + </header> + <body> + {{ template "nav" . }} + <main> + {{ $repo := .name }} + {{ $ref := .ref }} + {{ $parent := .parent }} + + <div class="tree"> + {{ if $parent }} + <div></div> + <div><a href="../">..</a></div> + {{ end }} + {{ range .files }} + <div class="mode">{{ .Mode }}</div> + <div> + {{ if .IsFile }} + {{ if $parent }} + <a href="/{{ $repo }}/blob/{{ $ref }}/{{ $parent }}/{{ .Name }}">{{ .Name }}</a> + {{ else }} + <a href="/{{ $repo }}/blob/{{ $ref }}/{{ .Name }}">{{ .Name }}</a> + {{ end }} + {{ else }} + {{ if $parent }} + <a href="/{{ $repo }}/tree/{{ $ref }}/{{ $parent }}/{{ .Name }}">{{ .Name }}/</a> + {{ else }} + <a href="/{{ $repo }}/tree/{{ $ref }}/{{ .Name }}">{{ .Name }}/</a> + {{ end }} + {{ end }} + </div> + {{ end }} + </div> + <article> + <pre> + {{- if .readme }}{{ .readme }}{{- end -}} + </pre> + </article> + </main> + </body> +</html> +{{ end }} |