implemented #1721: see users who forked/starred/watched a repository

This commit is contained in:
Steven 2015-10-01 15:17:27 +02:00
parent e0a099ec11
commit c8aa9c6cb1
10 changed files with 476 additions and 0 deletions

27
templates/repo/forks.tmpl Normal file
View file

@ -0,0 +1,27 @@
{{template "ng/base/head" .}}
{{template "ng/base/header" .}}
<div id="repo-wrapper">
{{template "repo/header_old" .}}
<div id="repo-content" class="clear container">
<div id="repo-main" class="left grid-5-6">
<div id="forks">
<h4>
<strong>{{.i18n.Tr "repos.forks"}}</strong>
</h4>
<ol>
{{range .Forks}}
<p>
<img class="avatar-small" src="{{.Owner.AvatarLink}}">
<a href="{{AppSubUrl}}/{{.Owner.Name}}">{{.Owner.Name}}</a>
/
<a href="{{AppSubUrl}}/{{.Owner.Name}}/{{.Name}}">{{.Name}}</a>
</p>
{{end}}
</div>
</div>
{{template "repo/sidebar" .}}
</div>
</div>
{{template "ng/base/footer" .}}

61
templates/repo/stars.tmpl Normal file
View file

@ -0,0 +1,61 @@
{{template "ng/base/head" .}}
{{template "ng/base/header" .}}
<div id="repo-wrapper">
{{template "repo/header_old" .}}
<div id="repo-content" class="clear container">
<div id="repo-main" class="left grid-5-6">
<div id="stars">
<h4>
<strong>{{.i18n.Tr "repos.stars"}}</strong>
</h4>
<ol>
{{range .Stars}}
<li>
<a href="{{AppSubUrl}}/{{.Name}}">
<img class="avatar" src="{{.AvatarLink}}" title="{{.Name}}"/>
<h3>{{.Name}}</h3>
</a>
<p>
{{if .Website}}
<span class="octicon octicon-link"></span> <a href="{{.Website}}" target="_blank">{{.Website}}</a>
{{else if .Location}}
<span class="octicon octicon-location"></span> {{.Location}}
{{else}}
<span class="octicon octicon-clock"></span> {{$.i18n.Tr "user.join_on"}} {{DateFmtShort .Created}}
{{end}}
</p>
</li>
{{end}}
</ol>
{{with .Page}}
{{if gt .TotalPages 1}}
<div class="pagination">
{{if .HasPrevious}}
<a href="{{$.RepoLink}}/stars/{{.Previous}}">{{$.i18n.Tr "issues.previous"}}</a>
{{end}}
{{range .Pages}}
{{if eq .Num -1}}
<a class="disabled item">...</a>
{{else}}
<a class="{{if .IsCurrent}}active{{end}} item" {{if not .IsCurrent}}href="{{$.RepoLink}}/stars/{{.Num}}"{{end}}>{{.Num}}</a>
{{end}}
{{end}}
{{if .HasNext}}
<a href="{{$.RepoLink}}/stars/{{.Next}}">{{$.i18n.Tr "issues.next"}}</a>
{{end}}
</div>
{{end}}
{{end}}
</div>
</div>
{{template "repo/sidebar" .}}
</div>
</div>
{{template "ng/base/footer" .}}

View file

@ -0,0 +1,61 @@
{{template "ng/base/head" .}}
{{template "ng/base/header" .}}
<div id="repo-wrapper">
{{template "repo/header_old" .}}
<div id="repo-content" class="clear container">
<div id="repo-main" class="left grid-5-6">
<div id="stars">
<h4>
<strong>{{.i18n.Tr "repos.watches"}}</strong>
</h4>
<ol>
{{range .Watchers}}
<li>
<a href="{{AppSubUrl}}/{{.Name}}">
<img class="avatar" src="{{.AvatarLink}}" title="{{.Name}}"/>
<h3>{{.Name}}</h3>
</a>
<p>
{{if .Website}}
<span class="octicon octicon-link"></span> <a href="{{.Website}}" target="_blank">{{.Website}}</a>
{{else if .Location}}
<span class="octicon octicon-location"></span> {{.Location}}
{{else}}
<span class="octicon octicon-clock"></span> {{$.i18n.Tr "user.join_on"}} {{DateFmtShort .Created}}
{{end}}
</p>
</li>
{{end}}
</ol>
{{with .Page}}
{{if gt .TotalPages 1}}
<div class="pagination">
{{if .HasPrevious}}
<a href="{{$.RepoLink}}/watchers/{{.Previous}}">{{$.i18n.Tr "issues.previous"}}</a>
{{end}}
{{range .Pages}}
{{if eq .Num -1}}
<a class="disabled item">...</a>
{{else}}
<a class="{{if .IsCurrent}}active{{end}} item" {{if not .IsCurrent}}href="{{$.RepoLink}}/watchers/{{.Num}}"{{end}}>{{.Num}}</a>
{{end}}
{{end}}
{{if .HasNext}}
<a href="{{$.RepoLink}}/watchers/{{.Next}}">{{$.i18n.Tr "issues.next"}}</a>
{{end}}
</div>
{{end}}
{{end}}
</div>
</div>
{{template "repo/sidebar" .}}
</div>
</div>
{{template "ng/base/footer" .}}