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

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  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. {{avatar $.Context .User 28 "gt-mr-2"}}<a href="{{.User.HomeLink}}">{{$userName}}</a>
  22. {{else}}
  23. {{avatarByEmail $.Context .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 $.Reponame}}
  47. <a href="{{$commitRepoLink}}/commit/{{.ID}}" rel="nofollow" class="{{$class}}">
  48. {{else}}
  49. <span class="{{$class}}">
  50. {{end}}
  51. <span class="shortsha">{{ShortSha .ID.String}}</span>
  52. {{if .Signature}}
  53. {{template "repo/shabox_badge" dict "root" $ "verification" .Verification}}
  54. {{end}}
  55. {{if $.PageIsWiki}}
  56. </a>
  57. {{else if $.Reponame}}
  58. </a>
  59. {{else}}
  60. </span>
  61. {{end}}
  62. </td>
  63. <td class="message">
  64. <span class="message-wrapper">
  65. {{if $.PageIsWiki}}
  66. <span class="commit-summary {{if gt .ParentCount 1}} grey text{{end}}" title="{{.Summary}}">{{.Summary | RenderEmoji $.Context}}</span>
  67. {{else}}
  68. {{$commitLink:= printf "%s/commit/%s" $commitRepoLink (PathEscape .ID.String)}}
  69. <span class="commit-summary {{if gt .ParentCount 1}} grey text{{end}}" title="{{.Summary}}">{{RenderCommitMessageLinkSubject $.Context .Message $commitRepoLink $commitLink $.Repository.ComposeMetas}}</span>
  70. {{end}}
  71. </span>
  72. {{if IsMultilineCommitMessage .Message}}
  73. <button class="ui button js-toggle-commit-body ellipsis-button" aria-expanded="false">...</button>
  74. {{end}}
  75. {{template "repo/commit_statuses" dict "Status" .Status "Statuses" .Statuses "root" $}}
  76. {{if IsMultilineCommitMessage .Message}}
  77. <pre class="commit-body gt-hidden">{{RenderCommitBody $.Context .Message $commitRepoLink $.Repository.ComposeMetas}}</pre>
  78. {{end}}
  79. </td>
  80. {{if .Committer}}
  81. <td class="text right aligned">{{TimeSince .Committer.When $.locale}}</td>
  82. {{else}}
  83. <td class="text right aligned">{{TimeSince .Author.When $.locale}}</td>
  84. {{end}}
  85. </tr>
  86. {{end}}
  87. </tbody>
  88. </table>
  89. </div>