summaryrefslogtreecommitdiffstats
path: root/templates/commit.html
diff options
context:
space:
mode:
authorLibravatar cel 🌸 <cel@blos.sm>2024-02-20 00:24:38 +0000
committerLibravatar cel 🌸 <cel@blos.sm>2024-02-20 00:24:38 +0000
commitf4ff8fe6eb20ab5b557d7beac095959890e126e8 (patch)
tree41e3c708a0c5c3cb4a318ebcd7739e3f2dc74552 /templates/commit.html
parentac0983a89692534daa3d36dba528461b5bb32dbc (diff)
downloadlegit-f4ff8fe6eb20ab5b557d7beac095959890e126e8.tar.gz
legit-f4ff8fe6eb20ab5b557d7beac095959890e126e8.tar.bz2
legit-f4ff8fe6eb20ab5b557d7beac095959890e126e8.zip
fix routes
Diffstat (limited to 'templates/commit.html')
-rw-r--r--templates/commit.html147
1 files changed, 75 insertions, 72 deletions
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 @@
<html>
{{ template "head" . }}
- {{ template "repoheader" . }}
- <body>
- {{ template "nav" . }}
- <main>
- <section class="commit">
- <pre>
- {{- .commit.Message -}}
- </pre>
- <div class="commit-info">
- {{ .commit.Author.Name }} <a href="mailto:{{ .commit.Author.Email }}" class="commit-email">{{ .commit.Author.Email}}</a>
+{{ template "repoheader" . }}
+
+<body>
+ {{ template "nav" . }}
+ <main>
+ <section class="commit">
+ <pre>
+ {{- .commit.Message -}}
+ </pre>
+ <div class="commit-info">
+ {{ .commit.Author.Name }} <a href="mailto:{{ .commit.Author.Email }}" class="commit-email">{{
+ .commit.Author.Email}}</a>
<div>{{ .commit.Author.When.Format "Mon, 02 Jan 2006 15:04:05 -0700" }}</div>
- </div>
+ </div>
- <div>
+ <div>
<strong>commit</strong>
- <p><a href="/{{ .name }}/commit/{{ .commit.This }}" class="commit-hash">
- {{ .commit.This }}
- </a>
+ <p><a href="/{{ .repo }}/commit/{{ .commit.This }}" class="commit-hash">
+ {{ .commit.This }}
+ </a>
</p>
- </div>
+ </div>
- {{ if .commit.Parent }}
- <div>
+ {{ if .commit.Parent }}
+ <div>
<strong>parent</strong>
- <p><a href="/{{ .name }}/commit/{{ .commit.Parent }}" class="commit-hash">
- {{ .commit.Parent }}
- </a></p>
- </div>
+ <p><a href="/{{ .repo }}/commit/{{ .commit.Parent }}" class="commit-hash">
+ {{ .commit.Parent }}
+ </a></p>
+ </div>
- {{ end }}
- <div class="diff-stat">
- <div>
+ {{ end }}
+ <div class="diff-stat">
+ <div>
{{ .stat.FilesChanged }} files changed,
{{ .stat.Insertions }} insertions(+),
{{ .stat.Deletions }} deletions(-)
- </div>
- <div>
- <br>
- <strong>jump to</strong>
- {{ range .diff }}
- <ul>
+ </div>
+ <div>
+ <br>
+ <strong>jump to</strong>
+ {{ range .diff }}
+ <ul>
<li><a href="#{{ .Name.New }}">{{ .Name.New }}</a></li>
- </ul>
- {{ end }}
- </div>
+ </ul>
+ {{ end }}
</div>
- </section>
- <section>
- {{ $repo := .name }}
- {{ $this := .commit.This }}
- {{ $parent := .commit.Parent }}
- {{ range .diff }}
- <div id="{{ .Name.New }}">
- <div class="diff">
- {{ if .IsNew }}
- <span class="diff-type">A</span>
- {{ end }}
- {{ if .IsDelete }}
- <span class="diff-type">D</span>
- {{ end }}
- {{ if not (or .IsNew .IsDelete) }}
- <span class="diff-type">M</span>
- {{ end }}
+ </div>
+ </section>
+ <section>
+ {{ $repo := .repo }}
+ {{ $this := .commit.This }}
+ {{ $parent := .commit.Parent }}
+ {{ range .diff }}
+ <div id="{{ .Name.New }}">
+ <div class="diff">
+ {{ if .IsNew }}
+ <span class="diff-type">A</span>
+ {{ end }}
+ {{ if .IsDelete }}
+ <span class="diff-type">D</span>
+ {{ end }}
+ {{ if not (or .IsNew .IsDelete) }}
+ <span class="diff-type">M</span>
+ {{ end }}
{{ if .Name.Old }}
<a href="/{{ $repo }}/blob/{{ $parent }}/{{ .Name.Old }}">{{ .Name.Old }}</a>
{{ if .Name.New }}
- &#8594;
- <a href="/{{ $repo }}/blob/{{ $this }}/{{ .Name.New }}">{{ .Name.New }}</a>
+ &#8594;
+ <a href="/{{ $repo }}/blob/{{ $this }}/{{ .Name.New }}">{{ .Name.New }}</a>
{{ end }}
{{ else }}
<a href="/{{ $repo }}/blob/{{ $this }}/{{ .Name.New }}">{{ .Name.New }}</a>
@@ -77,28 +79,29 @@
{{ if .IsBinary }}
<p>Not showing binary file.</p>
{{ else }}
- <pre>
+ <pre>
{{- range .TextFragments -}}
<p>{{- .Header -}}</p>
{{- range .Lines -}}
- {{- if eq .Op.String "+" -}}
- <span class="diff-add">{{ .String }}</span>
- {{- end -}}
- {{- if eq .Op.String "-" -}}
- <span class="diff-del">{{ .String }}</span>
- {{- end -}}
- {{- if eq .Op.String " " -}}
- <span class="diff-noop">{{ .String }}</span>
- {{- end -}}
+ {{- if eq .Op.String "+" -}}
+ <span class="diff-add">{{ .String }}</span>
{{- end -}}
+ {{- if eq .Op.String "-" -}}
+ <span class="diff-del">{{ .String }}</span>
{{- end -}}
- {{- end -}}
- </pre>
- </div>
- </div>
- {{ end }}
- </section>
- </main>
- </body>
+ {{- if eq .Op.String " " -}}
+ <span class="diff-noop">{{ .String }}</span>
+ {{- end -}}
+ {{- end -}}
+ {{- end -}}
+ {{- end -}}
+ </pre>
+ </div>
+ </div>
+ {{ end }}
+ </section>
+ </main>
+</body>
+
</html>
-{{ end }}
+{{ end }} \ No newline at end of file