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

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  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. {{avatar .User 28 "mr-2"}}<a href="{{AppSubUrl}}/{{.User.Name}}">{{$userName}}</a>
  22. {{else}}
  23. {{avatarByEmail .Author.Email .Author.Name 28 "mr-2"}}
  24. {{$userName}}
  25. {{end}}
  26. </td>
  27. <td class="sha">
  28. {{$class := "ui sha label"}}
  29. {{if .Signature}}
  30. {{$class = (printf "%s%s" $class " isSigned")}}
  31. {{if .Verification.Verified}}
  32. {{if eq .Verification.TrustStatus "trusted"}}
  33. {{$class = (printf "%s%s" $class " isVerified")}}
  34. {{else if eq .Verification.TrustStatus "untrusted"}}
  35. {{$class = (printf "%s%s" $class " isVerifiedUntrusted")}}
  36. {{else}}
  37. {{$class = (printf "%s%s" $class " isVerifiedUnmatched")}}
  38. {{end}}
  39. {{else if .Verification.Warning}}
  40. {{$class = (printf "%s%s" $class " isWarning")}}
  41. {{end}}
  42. {{end}}
  43. {{if $.PageIsWiki}}
  44. <a href="{{AppSubUrl}}/{{$.Username}}/{{$.Reponame}}/wiki/commit/{{.ID}}" rel="nofollow" class="{{$class}}">
  45. {{else if $.Reponame}}
  46. <a href="{{AppSubUrl}}/{{$.Username}}/{{$.Reponame}}/commit/{{.ID}}" rel="nofollow" class="{{$class}}">
  47. {{else}}
  48. <span class="{{$class}}">
  49. {{end}}
  50. <span class="shortsha">{{ShortSha .ID.String}}</span>
  51. {{if .Signature}}
  52. {{template "repo/shabox_badge" dict "root" $ "verification" .Verification}}
  53. {{end}}
  54. {{if $.Reponame}}
  55. </a>
  56. {{else}}
  57. </span>
  58. {{end}}
  59. </td>
  60. <td class="message">
  61. <span class="message-wrapper">
  62. {{if $.PageIsWiki}}
  63. <span class="commit-summary {{if gt .ParentCount 1}} grey text{{end}}" title="{{.Summary}}">{{.Summary | RenderEmoji}}</span>
  64. {{else }}
  65. {{ $commitLink:= printf "%s/%s/%s/commit/%s" AppSubUrl $.Username $.Reponame .ID }}
  66. <span class="commit-summary {{if gt .ParentCount 1}} grey text{{end}}" title="{{.Summary}}">{{RenderCommitMessageLinkSubject .Message $.RepoLink $commitLink $.Repository.ComposeMetas}}</span>
  67. {{end}}
  68. </span>
  69. {{if IsMultilineCommitMessage .Message}}
  70. <button class="basic compact mini ui icon button commit-button"><i class="ellipsis horizontal icon"></i></button>
  71. {{end}}
  72. {{if eq (CommitType .) "SignCommitWithStatuses"}}
  73. {{template "repo/commit_statuses" dict "Status" .Status "Statuses" .Statuses "root" $}}
  74. {{end}}
  75. {{if IsMultilineCommitMessage .Message}}
  76. <pre class="commit-body" style="display: none;">{{RenderCommitBody .Message $.RepoLink $.Repository.ComposeMetas}}</pre>
  77. {{end}}
  78. </td>
  79. <td class="text right aligned">{{TimeSince .Author.When $.Lang}}</td>
  80. </tr>
  81. {{end}}
  82. </tbody>
  83. </table>
  84. </div>