scripts/
static/
templates/
commit.html
2.0 KiB
discussion.html
1.7 KiB
discussion_new.html
801 B
discussions.html
959 B
error.html
266 B
home.html
2.8 KiB
index.html
506 B
layout.html
3.4 KiB
log.html
1.4 KiB
login.html
1.7 KiB
refs.html
1.2 KiB
.gitignore
30 B
.gitsigners
112 B
AGENTS.md
7.5 KiB
LICENSE
89 B
README.md
1.9 KiB
deploy
723 B
discuss.go
16.7 KiB
git.go
3.5 KiB
git_cli.go
16.0 KiB
git_http.go
1.9 KiB
go.mod
572 B
go.sum
1.9 KiB
handler.go
11.3 KiB
handler_test.go
69.0 KiB
main.go
5.2 KiB
template.go
8.9 KiB
watch
272 B
templates/home.html
raw
| 1 | {{define "content"}} |
| 2 | {{if .Data.IsEmpty}} |
| 3 | <p class="empty">This repository is empty.</p> |
| 4 | {{else}} |
| 5 | |
| 6 | <nav class="view-nav"> |
| 7 | <details class="branch-selector"> |
| 8 | <summary>{{.Data.DefaultRef}}</summary> |
| 9 | <ul> |
| 10 | {{range .Data.Branches}} |
| 11 | <li{{if eq .Name $.Data.DefaultRef}} class="active"{{end}}><a href="{{$.BaseURL}}/{{$.Repo}}/tree/{{.Name}}/">{{.Name}}</a></li> |
| 12 | {{end}} |
| 13 | </ul> |
| 14 | </details> |
| 15 | {{if .Data.LastCommit}} |
| 16 | <div class="last-commit"> |
| 17 | <span class="hash"><a href="{{.BaseURL}}/{{.Repo}}/commit/{{.Data.LastCommit.Hash}}">{{.Data.LastCommit.ShortHash}}</a></span> |
| 18 | <span class="subject">{{.Data.LastCommit.Subject}}</span> |
| 19 | <span class="author">{{.Data.LastCommit.Author}}</span> |
| 20 | <span class="date">{{timeAgo .Data.LastCommit.AuthorDate}} ago</span> |
| 21 | </div> |
| 22 | {{end}} |
| 23 | <details class="clone-selector desktop"> |
| 24 | <summary>Clone</summary> |
| 25 | <div class="clone-dropdown"> |
| 26 | <label>Git HTTPS URL</label> |
| 27 | <input type="text" value="{{.Data.CloneHTTPS}}" readonly> |
| 28 | <label>Git SSH URL</label> |
| 29 | <input type="text" value="{{.Data.CloneSSH}}" readonly> |
| 30 | </div> |
| 31 | </details> |
| 32 | </nav> |
| 33 | |
| 34 | <div class="repo-home"> |
| 35 | <div class="file-tree"> |
| 36 | {{range .Data.Tree}} |
| 37 | <a class="tree-entry{{if .IsActive}} active{{end}}" href="{{$.BaseURL}}/{{$.Repo}}/tree/{{$.Data.DefaultRef}}/{{if and .IsDir .IsOpen}}{{parentPath .Path}}{{else}}{{.Path}}{{end}}" style="{{indent .Depth}}"> |
| 38 | <span class="name">{{.Name}}{{if .IsDir}}/{{end}}</span> |
| 39 | <span class="size">{{if not .IsDir}}{{formatSize .Size}}{{end}}</span> |
| 40 | </a> |
| 41 | {{end}} |
| 42 | </div> |
| 43 | |
| 44 | <div class="content-view"> |
| 45 | {{if .Data.ActiveBlob}} |
| 46 | <div class="file-view"> |
| 47 | <div class="file-header"> |
| 48 | <span class="file-name">{{.Data.ActivePath}}</span> |
| 49 | <span class="file-meta">{{formatSize .Data.ActiveBlob.Size}}</span> |
| 50 | <a class="file-action" href="{{.BaseURL}}/{{.Repo}}/raw/{{.Data.DefaultRef}}/{{.Data.ActivePath}}">raw</a> |
| 51 | </div> |
| 52 | {{if .Data.ActiveBlob.IsBinary}} |
| 53 | <p class="empty">Binary file. <a href="{{.BaseURL}}/{{.Repo}}/raw/{{.Data.DefaultRef}}/{{.Data.ActivePath}}">Download</a></p> |
| 54 | {{else}} |
| 55 | <div class="blob-view"> |
| 56 | <table class="blob-code"> |
| 57 | <tbody> |
| 58 | {{range $i, $line := .Data.ActiveBlob.Lines}} |
| 59 | <tr id="L{{add $i 1}}"> |
| 60 | <td class="line-num"><a href="#L{{add $i 1}}">{{add $i 1}}</a></td> |
| 61 | <td class="line-code"><pre{{with langClass $.Data.ActiveBlob.Name}} class="{{.}}"{{end}}>{{autolink $line}}</pre></td> |
| 62 | </tr> |
| 63 | {{end}} |
| 64 | </tbody> |
| 65 | </table> |
| 66 | </div> |
| 67 | {{end}} |
| 68 | </div> |
| 69 | {{else if .Data.Readme}} |
| 70 | <div class="file-view"> |
| 71 | <div class="file-header"> |
| 72 | <span class="file-name">{{.Data.Readme.Name}}</span> |
| 73 | </div> |
| 74 | <pre>{{autolink .Data.Readme.Content}}</pre> |
| 75 | </div> |
| 76 | {{end}} |
| 77 | </div> |
| 78 | </div> |
| 79 | |
| 80 | {{end}} |
| 81 | {{end}} |