navid/veinsforge / 5c5407cb827e0d8c63635a735b9a2dbe09f180953c94e0a70baf6a570d8a2135 / internal/web/templates/repo.html
repo.html
← internal/web/templates · 4015 bytes · raw · download
{{define "content"}}
<p class="kicker"><a href="{{ownerURL .Data.Repo}}">{{.Data.Repo.OwnerName}}</a> / repository</p>
<h1><a href="{{ownerURL .Data.Repo}}">{{.Data.Repo.OwnerName}}</a> / {{.Data.Repo.Name}}</h1>
{{if .Data.Repo.Description}}<p>{{.Data.Repo.Description}}</p>{{end}}
<p class="muted">
{{.Data.Repo.Visibility}}{{if .Data.Repo.Archived}} · archived{{end}} · {{.Data.StarCount}} stars{{if .Data.License}} · {{.Data.License}}{{end}}
{{if .Data.Rev}} · default branch <code>{{.Data.Rev}}</code>{{end}}
{{if .Data.LatestTag}} · latest tag <code>{{.Data.LatestTag}}</code>{{end}}
{{if .Data.Perms.CanAdmin}} · <a href="{{repoURL .Data.Repo}}/settings">settings</a>{{end}}
</p>
{{with .Data.Languages}}
<div class="language-bar" role="img" aria-label="Language breakdown">
<svg viewBox="0 0 100 10" preserveAspectRatio="none" aria-hidden="true" focusable="false">
{{range .}}<rect x="{{printf "%.3f" .Offset}}" y="0" width="{{printf "%.3f" .Percent}}" height="10" fill="{{.Color}}"><title>{{.Name}} {{printf "%.1f" .Percent}}%</title></rect>{{end}}
{{range .}}{{if .Offset}}<line class="language-gap" x1="{{printf "%.3f" .Offset}}" x2="{{printf "%.3f" .Offset}}" y1="0" y2="10" vector-effect="non-scaling-stroke"></line>{{end}}{{end}}
</svg>
</div>
<ul class="language-legend">
{{range .}}<li><svg class="language-dot" viewBox="0 0 10 10" aria-hidden="true" focusable="false"><circle cx="5" cy="5" r="5" fill="{{.Color}}"></circle></svg><span class="language-name">{{.Name}}</span> <span class="language-percent">{{printf "%.1f" .Percent}}%</span></li>{{end}}
</ul>
{{end}}
<p class="repo-actions">
{{if .User}}
<form method="post" action="{{repoURL .Data.Repo}}/star" class="inline">
<input type="hidden" name="csrf" value="{{.CSRF}}">
<button class="link" type="submit">{{if .Data.Starred}}unstar{{else}}star{{end}}</button>
</form>
{{else}}
<a href="/login?next={{repoURL .Data.Repo | urlquery}}">star</a>
{{end}}
</p>
<nav class="tabs" aria-label="Repository">
<a class="active" href="{{repoURL .Data.Repo}}">code</a>
<a href="{{repoURL .Data.Repo}}/issues">issues ({{.Data.IssueCount}})</a>
<a href="{{repoURL .Data.Repo}}/pulls">pull requests ({{.Data.PullCount}})</a>
<a href="{{repoURL .Data.Repo}}/commits">commits</a>
<a href="{{repoURL .Data.Repo}}/branches">branches ({{len .Data.Branches}})</a>
<a href="{{repoURL .Data.Repo}}/tags">tags ({{len .Data.Tags}})</a>
<a href="{{repoURL .Data.Repo}}/releases">releases</a>
<a href="{{repoURL .Data.Repo}}/clone">clone</a>
</nav>
{{if .Data.Empty}}
{{if .Data.Perms.CanAdmin}}
<h2>Empty repository</h2>
<p>No commits yet. See <a href="{{repoURL .Data.Repo}}/clone">Clone</a> for the clone command, then set a bookmark, add files, and push.</p>
{{end}}
{{else}}
{{with index .Data.Commits 0}}
<p class="commit-strip">
<span><strong>{{.Author}}</strong> — {{.Message}}</span>
<span class="muted"><a href="{{commitURL $.Data.Repo .Hash}}"><code>{{short .Hash}}</code></a> · {{timeago .Date}}</span>
</p>
{{end}}
{{if .Data.FilesError}}<p class="flash flash-error">{{.Data.FilesError}}</p>{{end}}
<ul class="file-list">
{{range .Data.Tree}}
<li>
{{if .IsDir}}
<a href="{{treeURL $.Data.Repo $.Data.Rev .Path}}">{{.Name}}/</a>
{{else}}
<a href="{{blobURL $.Data.Repo $.Data.Rev .Path}}">{{.Name}}</a>
{{end}}
</li>
{{else}}
<li class="muted">No tracked files.</li>
{{end}}
</ul>
<p class="small"><a href="{{repoURL .Data.Repo}}/tree/{{revPath .Data.Rev}}">Browse full tree</a> · <a href="{{repoURL .Data.Repo}}/commits/{{revPath .Data.Rev}}">History</a> · <a href="{{archiveURL .Data.Repo .Data.Rev}}">Download source</a></p>
{{if .Data.Readme}}
<div class="markdown">{{.Data.Readme}}</div>
{{end}}
{{end}}
{{if .Data.Activity}}
<h2>Activity</h2>
<ul class="activity">
{{range .Data.Activity}}<li><span class="muted">{{timeago .CreatedAt}}</span> {{if .ActorName}}{{.ActorName}} {{end}}{{.Kind}} {{.Detail}}</li>{{end}}
</ul>
{{end}}
{{end}}