3 files changed,
16 insertions(+),
19 deletions(-)
Author:
Oleksandr Smirnov
olexsmir@gmail.com
Committed at:
2026-03-06 16:04:31 +0200
Change ID:
rqrkorrltuvzpyulowtorxvowxvorror
Parent:
f421981
M
web/templates/repo_commit.html
@@ -1,3 +1,9 @@
+{{ define "_diff_type" }} +{{ if .IsNew }}<span class="diff-type diff-add">A</span> +{{ else if .IsDelete }}<span class="diff-type diff-del">D</span> +{{ else }}<span class="diff-type diff-mod">M</span>{{ end }} +{{ end }} + {{ define "repo_commit" }} {{ $commit := .P.Diff.Commit }} {{ $diff := .P.Diff.Diff }}@@ -65,11 +71,7 @@ {{ range $diff }}
{{ $path := .Name.New }} {{ if not $path }}{{ $path = .Name.Old }}{{ end }} <tr> - <td class="diff-type"> - {{ if .IsNew }}<span class="diff-type diff-add">A</span> - {{ else if .IsDelete }}<span class="diff-type diff-del">D</span> - {{ else }}<span class="diff-type diff-mod">M</span>{{ end }} - </td> + <td class="diff-type">{{ template "_diff_type" . }}</td> <td class="fill"> <a href="#{{ $path }}"> {{ if .IsRename }}{{ .Name.Old }} → {{ .Name.New }}@@ -93,9 +95,7 @@ {{ $path := .Name.New }}
{{ if not $path }}{{ $path = .Name.Old }}{{ end }} <div id="{{ $path }}"> <div class="diff"> - {{ if .IsNew }}<span class="diff-type diff-add">A</span> - {{ else if .IsDelete }}<span class="diff-type diff-del">D</span> - {{ else }}<span class="diff-type diff-mod">M</span>{{ end }} + {{ template "_diff_type" . }} {{ if .IsNew }}<a href="/{{ $.RepoName }}/blob/{{ $this }}/{{ .Name.New }}">{{ .Name.New }}</a>{{ else }} {{ if $parent }}<a href="/{{ $.RepoName }}/blob/{{ $parent }}/{{ .Name.New }}">{{ .Name.New }}</a>@@ -103,8 +103,7 @@ {{ else }}{{ .Name.Old }}{{ end }}
{{ if .IsRename }}→<a href="/{{ $.RepoName }}/blob/{{ $this }}/{{ .Name.New }}">{{ .Name.New }}</a>{{ end }} {{ end }} - {{ if .IsBinary }} - <p>Not showing binary file.</p> + {{ if .IsBinary }}<p>Not showing binary file.</p> {{ else }} <pre> {{- range .TextFragments -}}
M
web/templates/repo_index.html
@@ -35,22 +35,20 @@
<div class="repo-index-side"> <h2>Clone urls</h2> <pre>https://{{.Meta.Host}}/{{.RepoName}}</pre> - {{ if .Meta.SSHEnabled }}<pre>{{ .P.SSHUser }}@{{.Meta.Host}}:{{.RepoName}}</pre>{{end}} - {{- if .P.IsMirror -}} + {{ if .Meta.SSHEnabled }}<pre>{{.P.SSHUser}}@{{.Meta.Host}}:{{.RepoName}}</pre>{{end}} + {{ if .P.IsMirror }} <br> <h2>Mirror status</h2> <p> Last updated {{ humanizeRelTime .P.MirrorLastSync }} from: <a href="{{.P.MirrorURL}}" target="_blank">{{.P.MirrorURL}}</a> </p> - {{- end}} + {{ end }} </div> </section> - {{ end }} - {{- if .P.Readme }} - <article class="readme">{{- .P.Readme -}}</article> - {{- end -}} + {{ if .P.Readme }}<article class="readme">{{.P.Readme}}</article>{{ end }} + {{ end }} </main> </body> </html>
M
web/templates/repo_log.html
@@ -47,9 +47,9 @@ {{ end }}
</tbody> </table> <div class="center"> - {{- if .P.NextAfter }} + {{ if .P.NextAfter }} <a href="?after={{ urlencode .P.NextAfter }}">[load more]</a> - {{- end }} + {{ end }} </div> </main> </body>