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

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  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 $.PageIsWiki}}
  43. <a href="{{AppSubUrl}}/{{$.Username}}/{{$.Reponame}}/wiki/commit/{{.ID}}" rel="nofollow" class="{{$class}}">
  44. {{else if $.Reponame}}
  45. <a href="{{AppSubUrl}}/{{$.Username}}/{{$.Reponame}}/commit/{{.ID}}" rel="nofollow" class="{{$class}}">
  46. {{else}}
  47. <span class="{{$class}}">
  48. {{end}}
  49. <span class="shortsha">{{ShortSha .ID.String}}</span>
  50. {{if .Signature}}
  51. {{template "repo/shabox_badge" dict "root" $ "verification" .Verification}}
  52. {{end}}
  53. {{if $.Reponame}}
  54. </a>
  55. {{else}}
  56. </span>
  57. {{end}}
  58. </td>
  59. <td class="message">
  60. <span class="message-wrapper">
  61. {{if $.PageIsWiki}}
  62. <span class="commit-summary {{if gt .ParentCount 1}} grey text{{end}}" title="{{.Summary}}">{{.Summary | RenderEmoji}}</span>
  63. {{else }}
  64. {{ $commitLink:= printf "%s/%s/%s/commit/%s" AppSubUrl $.Username $.Reponame .ID }}
  65. <span class="commit-summary {{if gt .ParentCount 1}} grey text{{end}}" title="{{.Summary}}">{{RenderCommitMessageLinkSubject .Message $.RepoLink $commitLink $.Repository.ComposeMetas}}</span>
  66. {{end}}
  67. </span>
  68. {{if IsMultilineCommitMessage .Message}}
  69. <button class="basic compact mini ui icon button commit-button"><i class="ellipsis horizontal icon"></i></button>
  70. {{end}}
  71. {{if eq (CommitType .) "SignCommitWithStatuses"}}
  72. {{template "repo/commit_status" .Status}}
  73. {{end}}
  74. {{if IsMultilineCommitMessage .Message}}
  75. <pre class="commit-body" style="display: none;">{{RenderCommitBody .Message $.RepoLink $.Repository.ComposeMetas}}</pre>
  76. {{end}}
  77. </td>
  78. <td class="text right aligned">{{TimeSince .Author.When $.Lang}}</td>
  79. </tr>
  80. {{end}}
  81. </tbody>
  82. </table>
  83. </div>