{{define "title"}}Repos Admin{{end}}

{{define "repo"}}
    <li class="repo {{.TypeAsClassName}}">
      <span class="glyph octicon octicon-{{.TypeAsOcticonName}}"></span>
      <a href="{{.HTMLURL}}">{{.FullName}}</a>
      <span class="vintage">{{.DisplayVintage}}</span>
    </li>
{{end}}

{{define "body"}}

{{if .ReposError}}
  {{.ReposError}}
{{else}}
  {{len .Repos.AllRepos}} from {{len .Repos.OtherUserRepos}} other users

  <div class="repos">
    <h2>
      <a href="https://github.com/{{.User.Login}}">
      <img src="{{.User.AvatarURL}}" class="avatar">{{.User.Login}}</a>
    </h2>
    <ul>
      {{range .Repos.UserRepos}}
        {{template "repo" .}}
      {{end}}
    </ul>
  </div>

  {{range .Repos.OtherUserRepos}}
    <div class="repos">
      <h2>
        <a href="https://github.com/{{.User.Login}}">{{.User.Login}}</a>
      </h2>
      <ul>
        {{range .Repos}}
          {{template "repo" .}}
        {{end}}
      </ul>
    </div>
  {{end}}

{{end}}

{{end}}
