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.

60 lines
2.6 KiB

  1. {{ $r:= List .comment.Commits}}
  2. {{ $index := 0}}
  3. <div class="timeline-item commits-list">
  4. {{range $r}}
  5. {{ $tag := printf "%s-%d" $.comment.HashTag $index }}
  6. {{ $index = Add $index 1}}
  7. <div class="singular-commit" id="{{$tag}}">
  8. <span class="badge badge-commit">{{svg "octicon-git-commit"}}</span>
  9. {{if .User}}
  10. <a class="ui avatar image" href="{{AppSubUrl}}/{{.User.Name}}"><img src="{{.User.RelAvatarLink}}" alt=""/></a>
  11. {{else}}
  12. <img class="ui avatar image" src="{{AvatarLink .Author.Email}}" alt=""/>
  13. {{end}}
  14. <span class="ui float right shabox">
  15. {{if eq (CommitType .) "SignCommitWithStatuses"}}
  16. {{template "repo/commit_status" .Status}}
  17. {{end}}
  18. {{$class := "ui sha label"}}
  19. {{if .Signature}}
  20. {{$class = (printf "%s%s" $class " isSigned")}}
  21. {{if .Verification.Verified}}
  22. {{if eq .Verification.TrustStatus "trusted"}}
  23. {{$class = (printf "%s%s" $class " isVerified")}}
  24. {{else if eq .Verification.TrustStatus "untrusted"}}
  25. {{$class = (printf "%s%s" $class " isVerifiedUntrusted")}}
  26. {{else}}
  27. {{$class = (printf "%s%s" $class " isVerifiedUnmatched")}}
  28. {{end}}
  29. {{else if .Verification.Warning}}
  30. {{$class = (printf "%s%s" $class " isWarning")}}
  31. {{end}}
  32. {{end}}
  33. {{if $.comment.Issue.PullRequest.BaseRepo.Name}}
  34. <a href="{{AppSubUrl}}/{{$.comment.Issue.PullRequest.BaseRepo.OwnerName}}/{{$.comment.Issue.PullRequest.BaseRepo.Name}}/commit/{{.ID}}" rel="nofollow" class="{{$class}}">
  35. {{else}}
  36. <span class="{{$class}}">
  37. {{end}}
  38. <span class="shortsha">{{ShortSha .ID.String}}</span>
  39. {{if .Signature}}
  40. {{template "repo/shabox_badge" dict "root" $.root "verification" .Verification}}
  41. {{end}}
  42. {{if $.comment.Issue.PullRequest.BaseRepo.Name}}
  43. </a>
  44. {{else}}
  45. </span>
  46. {{end}}
  47. </span>
  48. {{ $commitLink:= printf "%s/%s/%s/commit/%s" AppSubUrl $.comment.Issue.PullRequest.BaseRepo.OwnerName $.comment.Issue.PullRequest.BaseRepo.Name .ID }}
  49. <span class="mono commit-summary {{if gt .ParentCount 1}} grey text{{end}}" title="{{.Summary}}">{{RenderCommitMessageLinkSubject .Message ($.comment.Issue.PullRequest.BaseRepo.Link|Escape) $commitLink $.comment.Issue.PullRequest.BaseRepo.ComposeMetas}}</span>
  50. {{if IsMultilineCommitMessage .Message}}
  51. <button class="basic compact mini ui icon button commit-button"><i class="ellipsis horizontal icon"></i></button>
  52. {{end}}
  53. {{if IsMultilineCommitMessage .Message}}
  54. <pre class="commit-body" style="display: none;">{{RenderCommitBody .Message ($.comment.Issue.PullRequest.BaseRepo.Link|Escape) $.comment.Issue.PullRequest.BaseRepo.ComposeMetas}}</pre>
  55. {{end}}
  56. </div>
  57. {{end}}
  58. </div>