From f4ff8fe6eb20ab5b557d7beac095959890e126e8 Mon Sep 17 00:00:00 2001 From: cel 🌸 Date: Tue, 20 Feb 2024 00:24:38 +0000 Subject: fix routes --- templates/commit.html | 147 +++++++++++++++++++++++---------------------- templates/log.html | 40 ++++++------ templates/nav.html | 22 +++---- templates/refs.html | 48 ++++++++------- templates/repo-header.html | 6 +- templates/repo.html | 57 +++++++++--------- templates/tree.html | 90 +++++++++++++-------------- 7 files changed, 210 insertions(+), 200 deletions(-) (limited to 'templates') diff --git a/templates/commit.html b/templates/commit.html index c1def17..3e6ec5e 100644 --- a/templates/commit.html +++ b/templates/commit.html @@ -2,74 +2,76 @@ {{ template "head" . }} - {{ template "repoheader" . }} - - {{ template "nav" . }} -
-
-
-          {{- .commit.Message -}}
-        
-
- {{ .commit.Author.Name }} {{ .commit.Author.Email}} +{{ template "repoheader" . }} + + + {{ template "nav" . }} +
+
+
+        {{- .commit.Message -}}
+      
+
+ {{ .commit.Author.Name }} {{ + .commit.Author.Email}}
{{ .commit.Author.When.Format "Mon, 02 Jan 2006 15:04:05 -0700" }}
-
+
-
+
commit -

- {{ .commit.This }} - +

+ {{ .commit.This }} +

-
+
- {{ if .commit.Parent }} -
+ {{ if .commit.Parent }} +
parent -

- {{ .commit.Parent }} -

-
+

+ {{ .commit.Parent }} +

+
- {{ end }} -
-
+ {{ end }} +
+
{{ .stat.FilesChanged }} files changed, {{ .stat.Insertions }} insertions(+), {{ .stat.Deletions }} deletions(-) -
-
-
- jump to - {{ range .diff }} -
    +
+
+
+ jump to + {{ range .diff }} + - {{ end }} -
+ + {{ end }}
-
-
- {{ $repo := .name }} - {{ $this := .commit.This }} - {{ $parent := .commit.Parent }} - {{ range .diff }} -
-
- {{ if .IsNew }} - A - {{ end }} - {{ if .IsDelete }} - D - {{ end }} - {{ if not (or .IsNew .IsDelete) }} - M - {{ end }} +
+
+
+ {{ $repo := .repo }} + {{ $this := .commit.This }} + {{ $parent := .commit.Parent }} + {{ range .diff }} +
+
+ {{ if .IsNew }} + A + {{ end }} + {{ if .IsDelete }} + D + {{ end }} + {{ if not (or .IsNew .IsDelete) }} + M + {{ end }} {{ if .Name.Old }} {{ .Name.Old }} {{ if .Name.New }} - → - {{ .Name.New }} + → + {{ .Name.New }} {{ end }} {{ else }} {{ .Name.New }} @@ -77,28 +79,29 @@ {{ if .IsBinary }}

Not showing binary file.

{{ else }} -
+          
             {{- range .TextFragments -}}
             

{{- .Header -}}

{{- range .Lines -}} - {{- if eq .Op.String "+" -}} - {{ .String }} - {{- end -}} - {{- if eq .Op.String "-" -}} - {{ .String }} - {{- end -}} - {{- if eq .Op.String " " -}} - {{ .String }} - {{- end -}} + {{- if eq .Op.String "+" -}} + {{ .String }} {{- end -}} + {{- if eq .Op.String "-" -}} + {{ .String }} {{- end -}} - {{- end -}} -
-
-
- {{ end }} -
-
- + {{- if eq .Op.String " " -}} + {{ .String }} + {{- end -}} + {{- end -}} + {{- end -}} + {{- end -}} + + + + {{ end }} + + + + -{{ end }} +{{ end }} \ No newline at end of file diff --git a/templates/log.html b/templates/log.html index 7d74cb3..e596149 100644 --- a/templates/log.html +++ b/templates/log.html @@ -2,24 +2,26 @@ {{ template "head" . }} - {{ template "repoheader" . }} - - {{ template "nav" . }} -
- {{ $repo := .name }} -
- {{ range .commits }} -
-
{{ slice .Hash.String 0 8 }}
-
{{ .Message }}
-
-
- {{ .Author.Name }} {{ .Author.Email }} -
{{ .Author.When.Format "Mon, 02 Jan 2006 15:04:05 -0700" }}
-
- {{ end }} +{{ template "repoheader" . }} + + + {{ template "nav" . }} +
+ {{ $repo := .repo }} +
+ {{ range .commits }} +
+ +
{{ .Message }}
+
+
+ {{ .Author.Name }} {{ .Author.Email }} +
{{ .Author.When.Format "Mon, 02 Jan 2006 15:04:05 -0700" }}
-
- + {{ end }} +
+
+ + -{{ end }} +{{ end }} \ No newline at end of file diff --git a/templates/nav.html b/templates/nav.html index 51c9a34..6f6b4dd 100644 --- a/templates/nav.html +++ b/templates/nav.html @@ -1,14 +1,14 @@ {{ define "nav" }} - +{{ end }} \ No newline at end of file diff --git a/templates/refs.html b/templates/refs.html index 76add7d..347ff3b 100644 --- a/templates/refs.html +++ b/templates/refs.html @@ -2,37 +2,39 @@ {{ template "head" . }} - {{ template "repoheader" . }} - - {{ template "nav" . }} -
- {{ $name := .name }} -

branches

-
+{{ template "repoheader" . }} + + + {{ template "nav" . }} +
+ {{ $name := .repo }} +

branches

+
{{ range .branches }} -
+
{{ .Name.Short }} browse log -
- {{ end }}
- {{ if .tags }} -

tags

-
+ {{ end }} +
+ {{ if .tags }} +

tags

+
{{ range .tags }}
- {{ .Name }} - browse - log - {{ if .Message }} -
{{ .Message }}
+ {{ .Name }} + browse + log + {{ if .Message }} +
{{ .Message }}
{{ end }} {{ end }} -
- {{ end }} -
- +
+ {{ end }} +
+ + -{{ end }} +{{ end }} \ No newline at end of file diff --git a/templates/repo-header.html b/templates/repo-header.html index f358278..fae5525 100644 --- a/templates/repo-header.html +++ b/templates/repo-header.html @@ -1,12 +1,12 @@ {{ define "repoheader" }}

- all repos - — {{ .name }} + all repos + — {{ .repo }} {{ if .ref }} @ {{ .ref }} {{ end }}

{{ .desc }}

-{{ end }} +{{ end }} \ No newline at end of file diff --git a/templates/repo.html b/templates/repo.html index 1cd9b5c..957faba 100644 --- a/templates/repo.html +++ b/templates/repo.html @@ -4,35 +4,36 @@ {{ template "repoheader" . }} - - {{ template "nav" . }} -
- {{ $repo := .name }} -
- {{ range .commits }} -
-
{{ slice .Hash.String 0 8 }}
-
{{ .Message }}
-
-
- {{ .Author.Name }} {{ .Author.Email }} -
{{ .Author.When.Format "Mon, 02 Jan 2006 15:04:05 -0700" }}
-
- {{ end }} + + {{ template "nav" . }} +
+ {{ $repo := .repo }} +
+ {{ range .commits }} +
+ +
{{ .Message }}
-{{- if .readme }} -
- {{- .readme -}} -
-{{- end -}} +
+ {{ .Author.Name }} {{ .Author.Email }} +
{{ .Author.When.Format "Mon, 02 Jan 2006 15:04:05 -0700" }}
+
+ {{ end }} +
+ {{- if .readme }} +
+ {{- .readme -}} +
+ {{- end -}} -
+
clone -
-git clone https://{{ .servername }}/{{ .name }}
-        
-
-
- +
+        git clone https://{{ .servername }}/{{ .repo }}
+      
+
+
+ + -{{ end }} +{{ end }} \ No newline at end of file diff --git a/templates/tree.html b/templates/tree.html index c4b7e4f..a4f0d1b 100644 --- a/templates/tree.html +++ b/templates/tree.html @@ -3,53 +3,55 @@ {{ template "head" . }} - {{ template "repoheader" . }} - - {{ template "nav" . }} -
- {{ $repo := .name }} - {{ $ref := .ref }} - {{ $parent := .parent }} +{{ template "repoheader" . }} -
+ + {{ template "nav" . }} +
+ {{ $repo := .repo }} + {{ $ref := .ref }} + {{ $parent := .parent }} + +
+ {{ if $parent }} +
+
+ + {{ end }} + {{ range .files }} + {{ if not .IsFile }} +
{{ .Mode }}
+
{{ .Size }}
+
{{ if $parent }} -
-
- - {{ end }} - {{ range .files }} - {{ if not .IsFile }} -
{{ .Mode }}
-
{{ .Size }}
-
- {{ if $parent }} - {{ .Name }}/ - {{ else }} - {{ .Name }}/ - {{ end }} -
- {{ end }} - {{ end }} - {{ range .files }} - {{ if .IsFile }} -
{{ .Mode }}
-
{{ .Size }}
-
- {{ if $parent }} - {{ .Name }} - {{ else }} - {{ .Name }} - {{ end }} -
+ {{ .Name }}/ + {{ else }} + {{ .Name }}/ {{ end }} +
+ {{ end }} + {{ end }} + {{ range .files }} + {{ if .IsFile }} +
{{ .Mode }}
+
{{ .Size }}
+
+ {{ if $parent }} + {{ .Name }} + {{ else }} + {{ .Name }} {{ end }}
-
-
-          {{- if .readme }}{{ .readme }}{{- end -}}
-        
-
-
- + {{ end }} + {{ end }} +
+
+
+        {{- if .readme }}{{ .readme }}{{- end -}}
+      
+
+
+ + -{{ end }} +{{ end }} \ No newline at end of file -- cgit