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

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  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. {{$class = (printf "%s%s" $class " isVerified")}}
  32. {{else if .Verification.Warning}}
  33. {{$class = (printf "%s%s" $class " isWarning")}}
  34. {{end}}
  35. {{end}}
  36. {{if $.Reponame}}
  37. <a href="{{AppSubUrl}}/{{$.Username}}/{{$.Reponame}}/commit/{{.ID}}" rel="nofollow" class="{{$class}}">
  38. {{else}}
  39. <span class="{{$class}}">
  40. {{end}}
  41. {{ShortSha .ID.String}}
  42. {{if .Signature}}
  43. <div class="ui detail icon button">
  44. {{if .Verification.Verified}}
  45. {{if ne .Verification.SigningUser.ID 0}}
  46. <i title="{{.Verification.Reason}}" class="lock green icon"></i>
  47. {{else}}
  48. <i title="{{.Verification.Reason}}" class="icons">
  49. <i class="green lock icon"></i>
  50. <i class="tiny inverted cog icon centerlock"></i>
  51. </i>
  52. {{end}}
  53. {{else if .Verification.Warning}}
  54. <i title="{{$.i18n.Tr .Verification.Reason}}" class="red unlock icon"></i>
  55. {{else}}
  56. <i title="{{$.i18n.Tr .Verification.Reason}}" class="unlock icon"></i>
  57. {{end}}
  58. </div>
  59. {{end}}
  60. {{if $.Reponame}}
  61. </a>
  62. {{else}}
  63. </span>
  64. {{end}}
  65. </td>
  66. <td class="message">
  67. <span class="message-wrapper">
  68. {{if $.PageIsWiki}}
  69. <span class="commit-summary has-emoji{{if gt .ParentCount 1}} grey text{{end}}" title="{{.Summary}}">{{.Summary}}</span>
  70. {{else }}
  71. {{ $commitLink:= printf "%s/%s/%s/commit/%s" AppSubUrl $.Username $.Reponame .ID }}
  72. <span class="commit-summary has-emoji{{if gt .ParentCount 1}} grey text{{end}}" title="{{.Summary}}">{{RenderCommitMessageLinkSubject .Message $.RepoLink $commitLink $.Repository.ComposeMetas}}</span>
  73. {{end}}
  74. </span>
  75. {{if IsMultilineCommitMessage .Message}}
  76. <button class="basic compact mini ui icon button commit-button"><i class="ellipsis horizontal icon"></i></button>
  77. {{end}}
  78. {{if eq (CommitType .) "SignCommitWithStatuses"}}
  79. {{template "repo/commit_status" .Status}}
  80. {{end}}
  81. {{if IsMultilineCommitMessage .Message}}
  82. <pre class="commit-body" style="display: none;">{{RenderCommitBody .Message $.RepoLink $.Repository.ComposeMetas}}</pre>
  83. {{end}}
  84. </td>
  85. <td class="text right aligned">{{TimeSince .Author.When $.Lang}}</td>
  86. </tr>
  87. {{end}}
  88. </tbody>
  89. </table>
  90. </div>