showcase
- v0.2.4
- 37 commits
- 1 branch
- 6 tags
- updated
- CI 2/2
commit.html
3.1 KB · 57 lines
1{{define "content" -}}2{{template "repohead" .}}3{{- $r := .Repo}}4<section class="box">5 <div class="commit-head">6 <h2 class="commit-title">{{.C.Subject}}</h2>7 {{- with .C.Body}}<p class="commit-body">{{.}}</p>{{end}}8 </div>9 <div class="box-commit commit-meta">10 {{template "who" (dict "R" $r "Name" .C.Author)}}11 <span class="commit-author">{{.C.Author}}</span>12 <span class="muted">committed <time datetime="{{.C.When.Format "2006-01-02T15:04:05Z07:00"}}" title="{{.C.When.Format "2006-01-02 15:04 MST"}}">{{ago .C.When}}</time></span>13 <span class="commit-ids">14 {{- range .Parents}}<span class="muted">parent</span> {{if .Href}}<a class="sha" href="{{.Href}}">{{slice .Name 0 7}}</a>{{else}}<span class="sha">{{slice .Name 0 7}}</span>{{end}} {{end -}}15 <span class="muted">commit</span> {{template "sha" (dict "R" $r "Hash" .C.Hash)}}16 </span>17 </div>18 {{- with $r.Sig .C.Hash}}19 <p class="sig-line{{if .Verified}} sig-line--verified{{end}}">20 {{- if .Verified}}{{template "icon" "lock"}}<b>Verified</b><span class="muted">{{with .Signer}}signed by {{.}}{{else}}signature verified by Gitea{{end}}{{if .Key}} with {{.KeyType}} key <code>{{.Key}}</code>{{end}}</span>21 {{- else}}{{template "icon" "unlock"}}<b>Signed</b><span class="muted">Gitea couldn't verify the signature.</span>{{end -}}22 </p>23 {{- end}}24 {{- with .Status}}25 <ul class="checks" id="checks">26 {{- range .Statuses}}27 <li class="ci--{{.Status}}">{{if eq .Status "success"}}{{template "icon" "check"}}{{else if or (eq .Status "failure") (eq .Status "error")}}{{template "icon" "x"}}{{else}}{{template "icon" "dot"}}{{end}}<b>{{.Context}}</b><span class="muted">{{.Description}}</span></li>28 {{- end}}29 </ul>30 {{- end}}31</section>32<p class="diff-summary">Showing <b>{{len .Files}} changed file{{if ne (len .Files) 1}}s{{end}}</b> with <span class="add">{{.Added}} addition{{if ne .Added 1}}s{{end}}</span> and <span class="del">{{.Deleted}} deletion{{if ne .Deleted 1}}s{{end}}</span>.</p>33{{- range .Files}}34<section class="box diff">35 <div class="box-head file-head">36 {{ficon .Path "blob"}}37 <span class="file-name">{{with .OldPath}}{{.}} → {{end}}{{.Path}}</span>38 {{- with .Status}}<span class="badge">{{.}}</span>{{end}}39 <span class="diffstat"><span class="add">+{{.Added}}</span> <span class="del">−{{.Deleted}}</span></span>40 </div>41 {{- if .Binary}}42 <p class="box-note">Binary file, not shown.</p>43 {{- else if .Lines}}44 <pre class="code"><code>45 {{- range .Lines}}<span class="line {{diff .Kind}}">46 {{- if eq .Kind 64}}{{.Text}}{{else}}<span class="ln">{{if .Old}}{{.Old}}{{end}}</span><span class="ln">{{if .New}}{{.New}}{{end}}</span><span class="sign" aria-hidden="true">{{printf "%c" .Kind}}</span>{{.Text}}{{end -}}47 </span>{{end -}}48 </code></pre>49 {{- if .Truncated}}<p class="box-note">Diff truncated. Clone the repository for the full change.</p>{{end}}50 {{- else if .Truncated}}51 <p class="box-note">Diff truncated. Clone the repository for the full change.</p>52 {{- else}}53 <p class="box-note">No content changes.</p>54 {{- end}}55</section>56{{- end}}57{{- end}}