574bc91c2e459aa8afd9f4c77698b3417ce47883 / internal/web/templates/repo.html · 1412 bytes · raw
{{define "title"}}{{.Owner}}/{{.RepoName}} · simplegit{{end}}
{{define "content"}}
{{template "repo_nav" .}}
{{if .Empty}}
<div class="card">
<p>The repository is empty so far. To put an existing project in it:</p>
<pre>cd existing_repo
git remote add origin {{.CloneURL}}
git push -u origin --all
git push origin --tags</pre>
</div>
{{else}}
<div class="repo-summary">
<a href="/{{.Owner}}/{{.RepoName}}/commits/{{.Branch}}"><strong>{{.CommitCount}}</strong> {{if eq .CommitCount 1}}commit{{else}}commits{{end}}</a>
<details class="branch-picker">
<summary><strong>{{.BranchCount}}</strong> {{if eq .BranchCount 1}}branch{{else}}branches{{end}}</summary>
<ul>
{{range .Branches}}
{{if eq . $.Branch}}<li class="current">✓ {{.}}</li>
{{else if eq . $.DefaultBranch}}<li><a href="/{{$.Owner}}/{{$.RepoName}}">{{.}}</a></li>
{{else}}<li><a href="/{{$.Owner}}/{{$.RepoName}}/tree/{{.}}">{{.}}</a></li>{{end}}
{{end}}
</ul>
</details>
<a href="/{{.Owner}}/{{.RepoName}}/releases"><strong>{{.TagCount}}</strong> {{if eq .TagCount 1}}tag{{else}}tags{{end}}</a>
{{if .LicenseName}}<a href="{{.LicenseHref}}">{{.LicenseName}}</a>{{end}}
</div>
<div class="repo-layout">
<nav class="file-tree-pane">{{template "filetree" .Tree}}</nav>
<div class="repo-content">
{{if .Readme}}<article class="prose">{{.Readme}}</article>{{end}}
</div>
</div>
{{end}}
{{end}}