{{define "title"}}{{.Repo.Name}}{{end}}

{{define "main"}}
<div class="container is-fullhd">
  {{if not .Path}}
  <p class="title is-1">{{.Repo.Name}}</p>
  <p class="subtitle is-5">{{ if .Repo.Description }}{{.Repo.Description}}{{else}}No description{{end}}</p>
  {{else}}
  {{template "repo_crumb" .}}
  {{end}}
  <nav class="panel is-primary">
    {{ if .Path }}
    <a href="/repo/{{.Repo.Name}}/tree/{{.Branch}}{{ if .ParentPath }}/{{.ParentPath}}{{end}}" class="panel-block">
      <span class="panel-icon">
        <i class="feather-16" data-feather="folder"></i>
      </span>
      ..
    </a>
    {{end}}
    {{$repoName := .Repo.Name}}
    {{$branch := .Branch}}
    {{$repoPath := .Path}}
    {{range .GitObjects}}
    <a href="/repo/{{$repoName}}/{{.ObjectType}}/{{$branch}}/{{ if
                $repoPath }}{{$repoPath}}/{{end}}{{.Path}}" class="panel-block">
      <span class="panel-icon">
        <i class="feather-16" data-feather={{ if eq .ObjectType "tree" }}"folder"{{else}}"file-text"{{end}}></i>
      </span>
      {{.Path}}
    </a>
    {{end}}
  </nav>
</div>
{{end}}