navid/veinsforge / 279a9e67c218fc0f6173bdaf2b85e16a9fba439641b368804ef78d9187d79813 / internal/web/templates/tree.html

tree.html

← internal/web/templates · 1557 bytes · raw · download

{{define "content"}}
<p class="kicker"><a href="{{repoURL .Data.Repo}}">{{.Data.Repo.OwnerName}}/{{.Data.Repo.Name}}</a> / {{.Data.Rev}}{{if .Data.Path}} / {{.Data.Path}}{{end}}</p>
<h1>{{if .Data.Path}}{{.Data.Path}}{{else}}{{.Data.Repo.Name}}{{end}}</h1>

<nav class="tabs" aria-label="Repository">
  <a class="active" href="{{repoURL .Data.Repo}}/tree/{{revPath .Data.Rev}}">code</a>
  <a href="{{repoURL .Data.Repo}}/issues">issues</a>
  <a href="{{repoURL .Data.Repo}}/pulls">pull requests</a>
  <a href="{{repoURL .Data.Repo}}/commits/{{revPath .Data.Rev}}">commits</a>
  <a href="{{repoURL .Data.Repo}}/branches">branches</a>
  <a href="{{repoURL .Data.Repo}}/tags">tags</a>
</nav>

<p class="small">
  <a href="{{treeURL .Data.Repo .Data.Rev ""}}">{{.Data.Repo.Name}}</a>
  {{if .Data.Path}} / <a href="{{treeURL .Data.Repo .Data.Rev .Data.Path}}">{{.Data.Path}}</a>{{end}}
  {{if .Data.Parent}} · <a href="{{treeURL .Data.Repo .Data.Rev .Data.Parent}}">parent directory</a>{{end}}
</p>

{{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}}

<ul class="file-list">
  {{range .Data.Entries}}
  <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">Directory is empty.</li>
  {{end}}
</ul>
{{end}}