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.

commits_list_small.tmpl 2.1KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. {{$index := 0}}
  2. <div class="timeline-item commits-list">
  3. {{range .comment.Commits}}
  4. {{$tag := printf "%s-%d" $.comment.HashTag $index}}
  5. {{$index = Eval $index "+" 1}}
  6. <div class="singular-commit" id="{{$tag}}">
  7. <span class="badge badge-commit">{{svg "octicon-git-commit"}}</span>
  8. {{if .User}}
  9. <a class="avatar" href="{{.User.HomeLink}}">{{ctx.AvatarUtils.Avatar .User}}</a>
  10. {{else}}
  11. {{ctx.AvatarUtils.AvatarByEmail .Author.Email .Author.Name}}
  12. {{end}}
  13. {{$commitLink:= printf "%s/commit/%s" $.comment.Issue.PullRequest.BaseRepo.Link (PathEscape .ID.String)}}
  14. <span class="shabox tw-flex tw-items-center tw-float-right">
  15. {{template "repo/commit_statuses" dict "Status" .Status "Statuses" .Statuses}}
  16. {{$class := "ui sha label"}}
  17. {{if .Signature}}
  18. {{$class = (print $class " isSigned")}}
  19. {{if .Verification.Verified}}
  20. {{if eq .Verification.TrustStatus "trusted"}}
  21. {{$class = (print $class " isVerified")}}
  22. {{else if eq .Verification.TrustStatus "untrusted"}}
  23. {{$class = (print $class " isVerifiedUntrusted")}}
  24. {{else}}
  25. {{$class = (print $class " isVerifiedUnmatched")}}
  26. {{end}}
  27. {{else if .Verification.Warning}}
  28. {{$class = (print $class " isWarning")}}
  29. {{end}}
  30. {{end}}
  31. <a href="{{$commitLink}}" rel="nofollow" class="tw-ml-2 {{$class}}">
  32. <span class="shortsha">{{ShortSha .ID.String}}</span>
  33. {{if .Signature}}
  34. {{template "repo/shabox_badge" dict "root" $.root "verification" .Verification}}
  35. {{end}}
  36. </a>
  37. </span>
  38. <span class="tw-font-mono commit-summary {{if gt .ParentCount 1}} grey text{{end}}" title="{{.Summary}}">{{RenderCommitMessageLinkSubject $.root.Context .Message $commitLink ($.comment.Issue.PullRequest.BaseRepo.ComposeMetas ctx)}}</span>
  39. {{if IsMultilineCommitMessage .Message}}
  40. <button class="ui button js-toggle-commit-body ellipsis-button" aria-expanded="false">...</button>
  41. {{end}}
  42. {{if IsMultilineCommitMessage .Message}}
  43. <pre class="commit-body tw-hidden">{{RenderCommitBody $.root.Context .Message ($.comment.Issue.PullRequest.BaseRepo.ComposeMetas ctx)}}</pre>
  44. {{end}}
  45. </div>
  46. {{end}}
  47. </div>