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

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. <div class="ui attached table segment commit-table">
  2. <table class="ui very basic striped table unstackable fixed" 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 .User 28 "mr-2"}}<a href="{{.User.HomeLink}}">{{$userName}}</a>
  22. {{else}}
  23. {{avatarByEmail .Author.Email .Author.Name 28 "mr-2"}}
  24. {{$userName}}
  25. {{end}}
  26. </td>
  27. <td class="sha df">
  28. <button class="ui button copy-commit-sha df 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 $.Reponame}}
  56. </a>
  57. {{else}}
  58. </span>
  59. {{end}}
  60. </td>
  61. <td class="message">
  62. <span class="message-wrapper">
  63. {{if $.PageIsWiki}}
  64. <span class="commit-summary {{if gt .ParentCount 1}} grey text{{end}}" title="{{.Summary}}">{{.Summary | RenderEmoji}}</span>
  65. {{else}}
  66. {{$commitLink:= printf "%s/commit/%s" $commitRepoLink (PathEscape .ID.String)}}
  67. <span class="commit-summary {{if gt .ParentCount 1}} grey text{{end}}" title="{{.Summary}}">{{RenderCommitMessageLinkSubject $.Context .Message $commitRepoLink $commitLink $.Repository.ComposeMetas}}</span>
  68. {{end}}
  69. </span>
  70. {{if IsMultilineCommitMessage .Message}}
  71. <button class="ui button ellipsis-button" aria-expanded="false">...</button>
  72. {{end}}
  73. {{template "repo/commit_statuses" dict "Status" .Status "Statuses" .Statuses "root" $}}
  74. {{if IsMultilineCommitMessage .Message}}
  75. <pre class="commit-body" style="display: none;">{{RenderCommitBody $.Context .Message $commitRepoLink $.Repository.ComposeMetas}}</pre>
  76. {{end}}
  77. </td>
  78. {{if .Committer}}
  79. <td class="text right aligned">{{TimeSince .Committer.When $.locale}}</td>
  80. {{else}}
  81. <td class="text right aligned">{{TimeSince .Author.When $.locale}}</td>
  82. {{end}}
  83. </tr>
  84. {{end}}
  85. </tbody>
  86. </table>
  87. </div>