navid/veinsforge / c446c7fc1c70449efa6323eae65e550b07bb588a0cdd16b757508de9eaf645d6 / internal/web/templates/pulls.html
pulls.html
← internal/web/templates · 1668 bytes · raw · download
{{define "content"}}
<p class="kicker"><a href="{{repoURL .Data.Repo}}">{{.Data.Repo.OwnerName}}/{{.Data.Repo.Name}}</a></p>
<h1>Pull requests</h1>
<p class="small">
{{if .User}}<a href="{{repoURL .Data.Repo}}/pulls/new">new pull request</a> · {{end}}
<a class="{{if eq .Data.State "open"}}active{{end}}" href="{{repoURL .Data.Repo}}/pulls?state=open">open ({{.Data.OpenCount}})</a> ·
<a class="{{if eq .Data.State "closed"}}active{{end}}" href="{{repoURL .Data.Repo}}/pulls?state=closed">closed ({{.Data.ClosedCount}})</a> ·
<a class="{{if eq .Data.State "merged"}}active{{end}}" href="{{repoURL .Data.Repo}}/pulls?state=merged">merged ({{.Data.MergedCount}})</a> ·
<a class="{{if eq .Data.State "all"}}active{{end}}" href="{{repoURL .Data.Repo}}/pulls?state=all">all</a>
</p>
<ul class="issue-list">
{{range .Data.Pulls}}
<li>
<a href="{{pullURL $.Data.Repo .Number}}">#{{.Number}} {{.Title}}</a>
<span class="state {{stateClass .State}}">{{.State}}</span>
<span class="muted">— <code>{{.HeadBranch}}</code> → <code>{{.BaseBranch}}</code>, {{.AuthorName}}, {{timeago .CreatedAt}}</span>
</li>
{{else}}
<li class="muted">No {{if eq .Data.State "all"}}pull requests{{else}}{{.Data.State}} pull requests{{end}}.</li>
{{end}}
</ul>
{{if or (gt .Data.Page 1) .Data.HasNext}}
<p class="pager">
{{if gt .Data.Page 1}}<a href="{{repoURL .Data.Repo}}/pulls?state={{.Data.State}}&page={{sub .Data.Page 1}}">← previous</a>{{end}}
<span class="muted">page {{.Data.Page}}</span>
{{if .Data.HasNext}}<a href="{{repoURL .Data.Repo}}/pulls?state={{.Data.State}}&page={{add .Data.Page 1}}">next →</a>{{end}}
</p>
{{end}}
{{end}}