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.

98 lines
4.2 KiB

  1. <div class="ui attached table segment">
  2. <table class="ui very basic striped fixed table single line" id="commits-table">
  3. <thead>
  4. <tr>
  5. <th class="four wide">{{.i18n.Tr "repo.commits.author"}}</th>
  6. <th class="two wide sha">SHA1</th>
  7. <th class="seven wide message">{{.i18n.Tr "repo.commits.message"}}</th>
  8. <th class="three wide right aligned">{{.i18n.Tr "repo.commits.date"}}</th>
  9. </tr>
  10. </thead>
  11. <tbody class="commit-list">
  12. {{ $r:= List .Commits}}
  13. {{range $r}}
  14. <tr>
  15. <td class="author">
  16. {{$userName := .Author.Name}}
  17. {{if .User}}
  18. {{if .User.FullName}}
  19. {{$userName = .User.FullName}}
  20. {{end}}
  21. <img class="ui avatar image" src="{{.User.RelAvatarLink}}" alt=""/>&nbsp;&nbsp;<a href="{{AppSubUrl}}/{{.User.Name}}">{{$userName}}</a>
  22. {{else}}
  23. <img class="ui avatar image" src="{{AvatarLink .Author.Email}}" alt=""/>&nbsp;&nbsp;{{$userName}}
  24. {{end}}
  25. </td>
  26. <td class="sha">
  27. {{$class := "ui sha label"}}
  28. {{if .Signature}}
  29. {{$class = (printf "%s%s" $class " isSigned")}}
  30. {{if .Verification.Verified}}
  31. {{if eq .Verification.TrustStatus "trusted"}}
  32. {{$class = (printf "%s%s" $class " isVerified")}}
  33. {{else if eq .Verification.TrustStatus "untrusted"}}
  34. {{$class = (printf "%s%s" $class " isVerifiedUntrusted")}}
  35. {{else}}
  36. {{$class = (printf "%s%s" $class " isVerifiedUnmatched")}}
  37. {{end}}
  38. {{else if .Verification.Warning}}
  39. {{$class = (printf "%s%s" $class " isWarning")}}
  40. {{end}}
  41. {{end}}
  42. {{if $.Reponame}}
  43. <a href="{{AppSubUrl}}/{{$.Username}}/{{$.Reponame}}/commit/{{.ID}}" rel="nofollow" class="{{$class}}">
  44. {{else}}
  45. <span class="{{$class}}">
  46. {{end}}
  47. <span class="shortsha">{{ShortSha .ID.String}}</span>
  48. {{if .Signature}}
  49. <div class="ui detail icon button">
  50. {{if .Verification.Verified}}
  51. <div title="{{if eq .Verification.TrustStatus "trusted"}}{{else if eq .Verification.TrustStatus "untrusted"}}{{$.i18n.Tr "repo.commits.signed_by_untrusted_user"}}: {{else}}{{$.i18n.Tr "repo.commits.signed_by_untrusted_user_unmatched"}}: {{end}}{{.Verification.Reason}}">
  52. {{if ne .Verification.SigningUser.ID 0}}
  53. <i class="lock icon"></i>
  54. <img class="ui signature avatar image" src="{{.Verification.SigningUser.RelAvatarLink}}" />
  55. {{else}}
  56. <i title="{{.Verification.Reason}}" class="icons">
  57. <i class="lock icon"></i>
  58. <i class="tiny inverted cog icon centerlock"></i>
  59. </i>
  60. <img class="ui signature avatar image" src="{{AvatarLink .Verification.SigningEmail}}" />
  61. {{end}}
  62. </div>
  63. {{else}}
  64. <i title="{{$.i18n.Tr .Verification.Reason}}" class="unlock icon"></i>
  65. {{end}}
  66. </div>
  67. {{end}}
  68. {{if $.Reponame}}
  69. </a>
  70. {{else}}
  71. </span>
  72. {{end}}
  73. </td>
  74. <td class="message">
  75. <span class="message-wrapper">
  76. {{if $.PageIsWiki}}
  77. <span class="commit-summary {{if gt .ParentCount 1}} grey text{{end}}" title="{{.Summary}}">{{.Summary | RenderEmoji}}</span>
  78. {{else }}
  79. {{ $commitLink:= printf "%s/%s/%s/commit/%s" AppSubUrl $.Username $.Reponame .ID }}
  80. <span class="commit-summary {{if gt .ParentCount 1}} grey text{{end}}" title="{{.Summary}}">{{RenderCommitMessageLinkSubject .Message $.RepoLink $commitLink $.Repository.ComposeMetas}}</span>
  81. {{end}}
  82. </span>
  83. {{if IsMultilineCommitMessage .Message}}
  84. <button class="basic compact mini ui icon button commit-button"><i class="ellipsis horizontal icon"></i></button>
  85. {{end}}
  86. {{if eq (CommitType .) "SignCommitWithStatuses"}}
  87. {{template "repo/commit_status" .Status}}
  88. {{end}}
  89. {{if IsMultilineCommitMessage .Message}}
  90. <pre class="commit-body" style="display: none;">{{RenderCommitBody .Message $.RepoLink $.Repository.ComposeMetas}}</pre>
  91. {{end}}
  92. </td>
  93. <td class="text right aligned">{{TimeSince .Author.When $.Lang}}</td>
  94. </tr>
  95. {{end}}
  96. </tbody>
  97. </table>
  98. </div>