You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

latest_commit.tmpl 2.3KB

12345678910111213141516171819202122232425262728293031
  1. {{if not .LatestCommit}}
  2. <div class="ui active tiny slow centered inline">…</div>
  3. {{else}}
  4. {{if .LatestCommitUser}}
  5. {{ctx.AvatarUtils.Avatar .LatestCommitUser 24 "tw-mr-1"}}
  6. {{if .LatestCommitUser.FullName}}
  7. <a class="muted author-wrapper" title="{{.LatestCommitUser.FullName}}" href="{{.LatestCommitUser.HomeLink}}"><strong>{{.LatestCommitUser.FullName}}</strong></a>
  8. {{else}}
  9. <a class="muted author-wrapper" title="{{if .LatestCommit.Author}}{{.LatestCommit.Author.Name}}{{else}}{{.LatestCommitUser.Name}}{{end}}" href="{{.LatestCommitUser.HomeLink}}"><strong>{{if .LatestCommit.Author}}{{.LatestCommit.Author.Name}}{{else}}{{.LatestCommitUser.Name}}{{end}}</strong></a>
  10. {{end}}
  11. {{else}}
  12. {{if .LatestCommit.Author}}
  13. {{ctx.AvatarUtils.AvatarByEmail .LatestCommit.Author.Email .LatestCommit.Author.Name 24 "tw-mr-1"}}
  14. <span class="author-wrapper" title="{{.LatestCommit.Author.Name}}"><strong>{{.LatestCommit.Author.Name}}</strong></span>
  15. {{end}}
  16. {{end}}
  17. <a rel="nofollow" class="ui sha label {{if .LatestCommit.Signature}} isSigned {{if .LatestCommitVerification.Verified}} isVerified{{if eq .LatestCommitVerification.TrustStatus "trusted"}}{{else if eq .LatestCommitVerification.TrustStatus "untrusted"}}Untrusted{{else}}Unmatched{{end}}{{else if .LatestCommitVerification.Warning}} isWarning{{end}}{{end}}" href="{{.RepoLink}}/commit/{{PathEscape .LatestCommit.ID.String}}">
  18. <span class="shortsha">{{ShortSha .LatestCommit.ID.String}}</span>
  19. {{if .LatestCommit.Signature}}
  20. {{template "repo/shabox_badge" dict "root" $ "verification" .LatestCommitVerification}}
  21. {{end}}
  22. </a>
  23. {{template "repo/commit_statuses" dict "Status" .LatestCommitStatus "Statuses" .LatestCommitStatuses}}
  24. {{$commitLink:= printf "%s/commit/%s" .RepoLink (PathEscape .LatestCommit.ID.String)}}
  25. <span class="grey commit-summary" title="{{.LatestCommit.Summary}}"><span class="message-wrapper">{{RenderCommitMessageLinkSubject $.Context .LatestCommit.Message $commitLink ($.Repository.ComposeMetas ctx)}}</span>
  26. {{if IsMultilineCommitMessage .LatestCommit.Message}}
  27. <button class="ui button js-toggle-commit-body ellipsis-button" aria-expanded="false">...</button>
  28. <pre class="commit-body tw-hidden">{{RenderCommitBody $.Context .LatestCommit.Message ($.Repository.ComposeMetas ctx)}}</pre>
  29. {{end}}
  30. </span>
  31. {{end}}