~gitpocket/gitpocket

4
3e6b98c68fd45f770106cc8797ef6ee93e9e0566
mainfeed-discovery
gitpocket/templates/meta.html -rw-r--r--2.9 KiB ViewLogBlameView rawPermalink 05701a4801 feat(repos): branch switcher and push notices 13 days ago
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
{{define "meta"}}
<div class="panel meta">
<h4>Labels</h4>
{{if .AllLabels}}<form method="post" action="{{.Action}}" class="metaform"><input type="hidden" name="labels_form" value="1">{{$have := .Labels}}{{range .AllLabels}}<label class="check"><input type="checkbox" name="label" value="{{.ID}}"{{range $have}}{{if eq .ID $.ID}}{{end}}{{end}}{{$id := .ID}}{{range $have}}{{if eq .ID $id}} checked{{end}}{{end}}> <span class="label" style="background:{{.Colour}}">{{.Name}}</span></label>{{end}}<button class="btn small">Save ▸</button></form>
{{else if .Labels}}{{range .Labels}}<span class="label" style="background:{{.Colour}}">{{.Name}}</span> {{end}}{{else}}<p class="muted small">None</p>{{end}}
<h4>Assignees</h4>
{{if .Assignable}}<form method="post" action="{{.Action}}" class="metaform"><input type="hidden" name="assignees_form" value="1">{{$have := .Assignees}}{{range .Assignable}}{{$id := .ID}}<label class="check"><input type="checkbox" name="assignee" value="{{.ID}}"{{range $have}}{{if eq .ID $id}} checked{{end}}{{end}}> ~{{.Name}}</label>{{end}}<button class="btn small">Save ▸</button></form>
{{else if .Assignees}}{{range .Assignees}}<a href="/~{{.Name}}">~{{.Name}}</a> {{end}}{{else}}<p class="muted small">Nobody</p>{{end}}
</div>
{{end}}
{{define "who"}}{{with person .Email}}<a href="/~{{.}}">{{$.Author}}</a>{{else}}{{.Author}}{{end}}{{end}}
{{define "repoitem"}}<div class="event repo"><h4><a href="/{{.Path}}">{{.Name}}</a>{{if .Private}} <span class="tag">private</span>{{else if .Unlisted}} <span class="tag">unlisted</span>{{end}}</h4>{{if .Description}}<p>{{.Description}}</p>{{end}}{{if .Tags}}<p class="tags">{{range .Tags}}<a href="/search?q=tag:{{.}}">#{{.}}</a> {{end}}</p>{{end}}{{template "repometa" .}}</div>{{end}}
{{define "repometa"}}{{$l := lang .}}<p class="repometa">{{with $l.Name}}<span><i class="dot" style="background:{{$l.Colour}}"></i>{{.}}</span>{{end}}<span title="{{.Stars}} star{{if ne .Stars 1}}s{{end}}"><svg viewBox="0 0 16 16" aria-hidden="true"><path d="M8 1.6l1.9 4 4.4.5-3.3 3 .9 4.3L8 11.2 4.1 13.4l.9-4.3-3.3-3 4.4-.5z"/></svg>{{.Stars}}</span><span title="{{.Forks}} fork{{if ne .Forks 1}}s{{end}}"><svg viewBox="0 0 16 16" aria-hidden="true"><circle cx="4" cy="3" r="1.6"/><circle cx="12" cy="3" r="1.6"/><circle cx="8" cy="13" r="1.6"/><path d="M4 4.6v1.4a2 2 0 0 0 2 2h4a2 2 0 0 0 2-2V4.6M8 8v3.4"/></svg>{{.Forks}}</span></p>{{end}}
{{define "pushed"}}{{$p := .Page}}{{range .Pushed}}<div class="pushnote"><svg viewBox="0 0 16 16" aria-hidden="true"><circle cx="4" cy="3" r="1.6"/><circle cx="4" cy="13" r="1.6"/><circle cx="12" cy="5" r="1.6"/><path d="M4 4.6v6.8M12 6.6c0 3-4 2.6-7.4 5.2"/></svg><span><strong>{{.Name}}</strong> had recent pushes {{ago .Time}}, {{.Ahead}} commit{{if ne .Ahead 1}}s{{end}} ahead of {{$p.Ref}}</span><a class="btn primary" href="/{{$p.Repo.Path}}/pulls/new?source={{$p.Repo.Path}}:{{.Name}}&amp;target={{$p.Ref}}">Open pull request ▸</a></div>{{end}}{{end}}