From ce71721c6dc80db8af63f2098a1548308e2621b2 Mon Sep 17 00:00:00 2001 From: Anirudh Oppiliappan Date: Sun, 11 Dec 2022 21:17:04 +0530 Subject: routes, templates: tree and log views --- templates/file.html | 2 +- templates/log.html | 21 +++++++++++++++++++++ templates/repo.html | 38 +++++++++++++++++++++++++++++++++----- 3 files changed, 55 insertions(+), 6 deletions(-) create mode 100644 templates/log.html (limited to 'templates') diff --git a/templates/file.html b/templates/file.html index 2ccf1c6..ed6073f 100644 --- a/templates/file.html +++ b/templates/file.html @@ -10,7 +10,7 @@ {{ template "nav" . }}
-        {{ .content }}
+{{ .content }}
       
diff --git a/templates/log.html b/templates/log.html new file mode 100644 index 0000000..357a5a8 --- /dev/null +++ b/templates/log.html @@ -0,0 +1,21 @@ +{{ define "log" }} + +{{ template "head" . }} + +
+

{{ .meta.Title }}

+

{{ .meta.Description }}

+
+ + {{ template "nav" . }} +
+ {{ $repo := .name }} + {{ range .commits }} +

{{ slice .Hash.String 0 8 }} + — {{ .Author.Name }}

+

{{ .Message }}

+ {{ end }} +
+ + +{{ end }} diff --git a/templates/repo.html b/templates/repo.html index e388de3..3c99df5 100644 --- a/templates/repo.html +++ b/templates/repo.html @@ -9,13 +9,41 @@ {{ template "nav" . }}
+ {{ $repo := .name }} + {{ $ref := .ref }} + {{ $parent := .parent }} + + + + + {{ range .files }} - {{ if .IsFile }} -

{{ .Mode }} {{ .Name }} {{ .Size }}

- {{ else }} -

d-------- {{ .Name}}/

- {{ end }} + {{ if .IsFile }} + + + + + {{ else }} + + + + + {{ end }} {{ end }} +
.. +
{{ .Mode }} + {{ if $parent }} + {{ .Name }} + {{ else }} + {{ .Name }} + {{ end }} +
{{ .Mode }} + {{ if $parent }} + {{ .Name }}/ + {{ else }} + {{ .Name }}/ + {{ end }} +
-- cgit