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_table.tmpl 4.4KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. <h4 class="ui top attached header">
  2. <div class="ui stackable grid">
  3. <div class="five wide column">
  4. {{if or .PageIsCommits (gt .CommitCount 0)}}
  5. {{.CommitCount}} {{.i18n.Tr "repo.commits.commits"}} {{if .Branch}}({{.Branch}}){{end}}
  6. {{else}}
  7. {{.i18n.Tr "repo.commits.no_commits" $.BaseBranch $.HeadBranch }} {{if .Branch}}({{.Branch}}){{end}}
  8. {{end}}
  9. </div>
  10. <div class="eleven wide right aligned column">
  11. {{if .PageIsCommits}}
  12. <form class="ignore-dirty" action="{{.RepoLink}}/commits/{{.BranchNameSubURL | EscapePound}}/search">
  13. <div class="ui tiny search input">
  14. <input name="q" placeholder="{{.i18n.Tr "repo.commits.search"}}" value="{{.Keyword}}" autofocus>
  15. </div>
  16. &nbsp;
  17. <div class="ui checkbox">
  18. <input type="checkbox" name="all" id="all" value="true" {{.All}}>
  19. <label for="all">{{.i18n.Tr "repo.commits.search_all"}} &nbsp;&nbsp;</label>
  20. </div>
  21. <button class="ui black tiny button" data-panel="#add-deploy-key-panel" data-tooltip={{.i18n.Tr "repo.commits.search.tooltip"}}>{{.i18n.Tr "repo.commits.find"}}</button>
  22. </form>
  23. {{else if .IsDiffCompare}}
  24. <a href="{{$.CommitRepoLink}}/commit/{{.BeforeCommitID}}" class="ui green sha label">{{if not .BaseIsCommit}}{{if .BaseIsBranch}}<i class="octicon octicon-git-branch"></i>{{else if .BaseIsTag}}<i class="octicon octicon-tag"></i>{{end}}{{.BaseBranch}}{{else}}{{ShortSha .BaseBranch}}{{end}}</a>
  25. ...
  26. <a href="{{$.CommitRepoLink}}/commit/{{.AfterCommitID}}" class="ui green sha label">{{if not .HeadIsCommit}}{{if .HeadIsBranch}}<i class="octicon octicon-git-branch"></i>{{else if .HeadIsTag}}<i class="octicon octicon-tag"></i>{{end}}{{.HeadBranch}}{{else}}{{ShortSha .HeadBranch}}{{end}}</a>
  27. {{end}}
  28. </div>
  29. </div>
  30. </h4>
  31. {{if and .Commits (gt .CommitCount 0)}}
  32. <div class="ui attached table segment">
  33. <table class="ui very basic striped fixed table single line" id="commits-table">
  34. <thead>
  35. <tr>
  36. <th class="four wide">{{.i18n.Tr "repo.commits.author"}}</th>
  37. <th class="two wide sha">SHA1</th>
  38. <th class="seven wide message">{{.i18n.Tr "repo.commits.message"}}</th>
  39. <th class="three wide right aligned">{{.i18n.Tr "repo.commits.date"}}</th>
  40. </tr>
  41. </thead>
  42. <tbody class="commit-list">
  43. {{ $r:= List .Commits}}
  44. {{range $r}}
  45. <tr>
  46. <td class="author">
  47. {{if .User}}
  48. {{if .User.FullName}}
  49. <img class="ui avatar image" src="{{.User.RelAvatarLink}}" alt=""/>&nbsp;&nbsp;<a href="{{AppSubUrl}}/{{.User.Name}}">{{.User.FullName}}</a>
  50. {{else}}
  51. <img class="ui avatar image" src="{{.User.RelAvatarLink}}" alt=""/>&nbsp;&nbsp;<a href="{{AppSubUrl}}/{{.User.Name}}">{{.Author.Name}}</a>
  52. {{end}}
  53. {{else}}
  54. <img class="ui avatar image" src="{{AvatarLink .Author.Email}}" alt=""/>&nbsp;&nbsp;{{.Author.Name}}
  55. {{end}}
  56. </td>
  57. <td class="sha">
  58. <a rel="nofollow" class="ui sha label {{if .Signature}} isSigned {{if .Verification.Verified }} isVerified {{end}}{{end}}" href="{{AppSubUrl}}/{{$.Username}}/{{$.Reponame}}/commit/{{.ID}}">
  59. {{ShortSha .ID.String}}
  60. {{if .Signature}}
  61. <div class="ui detail icon button">
  62. {{if .Verification.Verified}}
  63. <i title="{{.Verification.Reason}}" class="lock green icon"></i>
  64. {{else}}
  65. <i title="{{$.i18n.Tr .Verification.Reason}}" class="unlock icon"></i>
  66. {{end}}
  67. </div>
  68. {{end}}
  69. </a>
  70. </td>
  71. <td class="message">
  72. <span class="message-wrapper">
  73. {{ $commitLink:= printf "%s/%s/%s/commit/%s" AppSubUrl $.Username $.Reponame .ID }}
  74. <span class="commit-summary has-emoji{{if gt .ParentCount 1}} grey text{{end}}" title="{{.Summary}}">{{RenderCommitMessageLinkSubject .Message $.RepoLink $commitLink $.Repository.ComposeMetas}}</span>
  75. </span>
  76. {{if IsMultilineCommitMessage .Message}}
  77. <button class="basic compact mini ui icon button commit-button"><i class="ellipsis horizontal icon"></i></button>
  78. {{end}}
  79. {{template "repo/commit_status" .Status}}
  80. {{if IsMultilineCommitMessage .Message}}
  81. <pre class="commit-body" style="display: none;">{{RenderCommitBody .Message $.RepoLink $.Repository.ComposeMetas}}</pre>
  82. {{end}}
  83. </td>
  84. <td class="grey text right aligned">{{TimeSince .Author.When $.Lang}}</td>
  85. </tr>
  86. {{end}}
  87. </tbody>
  88. </table>
  89. </div>
  90. {{end}}
  91. {{template "base/paginate" .}}