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.tmpl 3.9KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. <div class="ui attached table segment commit-table">
  2. <table class="ui very basic striped table unstackable" id="commits-table">
  3. <thead>
  4. <tr>
  5. <th class="three wide">{{.locale.Tr "repo.commits.author"}}</th>
  6. <th class="two wide sha">SHA1</th>
  7. <th class="nine wide message">{{.locale.Tr "repo.commits.message"}}</th>
  8. <th class="two wide right aligned">{{.locale.Tr "repo.commits.date"}}</th>
  9. </tr>
  10. </thead>
  11. <tbody class="commit-list">
  12. {{$commitRepoLink := $.RepoLink}}{{if $.CommitRepoLink}}{{$commitRepoLink = $.CommitRepoLink}}{{end}}
  13. {{range .Commits}}
  14. <tr>
  15. <td class="author">
  16. {{$userName := .Author.Name}}
  17. {{if .User}}
  18. {{if .User.FullName}}
  19. {{$userName = .User.FullName}}
  20. {{end}}
  21. {{ctx.AvatarUtils.Avatar .User 28 "gt-mr-2"}}<a href="{{.User.HomeLink}}">{{$userName}}</a>
  22. {{else}}
  23. {{ctx.AvatarUtils.AvatarByEmail .Author.Email .Author.Name 28 "gt-mr-2"}}
  24. {{$userName}}
  25. {{end}}
  26. </td>
  27. <td class="sha gt-df">
  28. <button class="ui button copy-commit-sha gt-df gt-ac" data-clipboard-text="{{.ID}}">{{svg "octicon-copy" 14}}</button>
  29. {{$class := "ui sha label"}}
  30. {{if .Signature}}
  31. {{$class = (printf "%s%s" $class " isSigned")}}
  32. {{if .Verification.Verified}}
  33. {{if eq .Verification.TrustStatus "trusted"}}
  34. {{$class = (printf "%s%s" $class " isVerified")}}
  35. {{else if eq .Verification.TrustStatus "untrusted"}}
  36. {{$class = (printf "%s%s" $class " isVerifiedUntrusted")}}
  37. {{else}}
  38. {{$class = (printf "%s%s" $class " isVerifiedUnmatched")}}
  39. {{end}}
  40. {{else if .Verification.Warning}}
  41. {{$class = (printf "%s%s" $class " isWarning")}}
  42. {{end}}
  43. {{end}}
  44. {{if $.PageIsWiki}}
  45. <a href="{{$commitRepoLink}}/wiki/commit/{{.ID}}" rel="nofollow" class="{{$class}}">
  46. {{else if $.PageIsPullCommits}}
  47. <a href="{{$commitRepoLink}}/pulls/{{$.Issue.Index}}/commits/{{.ID}}" rel="nofollow" class="{{$class}}">
  48. {{else if $.Reponame}}
  49. <a href="{{$commitRepoLink}}/commit/{{.ID}}" rel="nofollow" class="{{$class}}">
  50. {{else}}
  51. <span class="{{$class}}">
  52. {{end}}
  53. <span class="shortsha">{{ShortSha .ID.String}}</span>
  54. {{if .Signature}}
  55. {{template "repo/shabox_badge" dict "root" $ "verification" .Verification}}
  56. {{end}}
  57. {{if $.PageIsWiki}}
  58. </a>
  59. {{else if $.PageIsPullCommits}}
  60. </a>
  61. {{else if $.Reponame}}
  62. </a>
  63. {{else}}
  64. </span>
  65. {{end}}
  66. </td>
  67. <td class="message">
  68. <span class="message-wrapper">
  69. {{if $.PageIsWiki}}
  70. <span class="commit-summary {{if gt .ParentCount 1}} grey text{{end}}" title="{{.Summary}}">{{.Summary | RenderEmoji $.Context}}</span>
  71. {{else}}
  72. {{$commitLink:= printf "%s/commit/%s" $commitRepoLink (PathEscape .ID.String)}}
  73. <span class="commit-summary {{if gt .ParentCount 1}} grey text{{end}}" title="{{.Summary}}">{{RenderCommitMessageLinkSubject $.Context .Message $commitRepoLink $commitLink $.Repository.ComposeMetas}}</span>
  74. {{end}}
  75. </span>
  76. {{if IsMultilineCommitMessage .Message}}
  77. <button class="ui button js-toggle-commit-body ellipsis-button" aria-expanded="false">...</button>
  78. {{end}}
  79. {{template "repo/commit_statuses" dict "Status" .Status "Statuses" .Statuses "root" $}}
  80. {{if IsMultilineCommitMessage .Message}}
  81. <pre class="commit-body gt-hidden">{{RenderCommitBody $.Context .Message $commitRepoLink $.Repository.ComposeMetas}}</pre>
  82. {{end}}
  83. </td>
  84. {{if .Committer}}
  85. <td class="text right aligned">{{TimeSince .Committer.When $.locale}}</td>
  86. {{else}}
  87. <td class="text right aligned">{{TimeSince .Author.When $.locale}}</td>
  88. {{end}}
  89. </tr>
  90. {{end}}
  91. </tbody>
  92. </table>
  93. </div>