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 3.8KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. <h4 class="ui top attached header">
  2. <div class="ui stackable grid">
  3. <div class="ten 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="six 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">{{ShortSha .BeforeCommitID}}</a> ... <a href="{{$.CommitRepoLink}}/commit/{{.AfterCommitID}}" class="ui green sha label">{{ShortSha .AfterCommitID}}</a>
  25. {{end}}
  26. </div>
  27. </div>
  28. </h4>
  29. {{if and .Commits (gt .CommitCount 0)}}
  30. <div class="ui attached table segment">
  31. <table class="ui very basic striped fixed table single line" id="commits-table">
  32. <thead>
  33. <tr>
  34. <th class="four wide">{{.i18n.Tr "repo.commits.author"}}</th>
  35. <th class="two wide sha">SHA1</th>
  36. <th class="seven wide message">{{.i18n.Tr "repo.commits.message"}}</th>
  37. <th class="three wide right aligned">{{.i18n.Tr "repo.commits.date"}}</th>
  38. </tr>
  39. </thead>
  40. <tbody class="commit-list">
  41. {{ $r:= List .Commits}}
  42. {{range $r}}
  43. <tr>
  44. <td class="author">
  45. {{if .User}}
  46. {{if .User.FullName}}
  47. <img class="ui avatar image" src="{{.User.RelAvatarLink}}" alt=""/>&nbsp;&nbsp;<a href="{{AppSubUrl}}/{{.User.Name}}">{{.User.FullName}}</a>
  48. {{else}}
  49. <img class="ui avatar image" src="{{.User.RelAvatarLink}}" alt=""/>&nbsp;&nbsp;<a href="{{AppSubUrl}}/{{.User.Name}}">{{.Author.Name}}</a>
  50. {{end}}
  51. {{else}}
  52. <img class="ui avatar image" src="{{AvatarLink .Author.Email}}" alt=""/>&nbsp;&nbsp;{{.Author.Name}}
  53. {{end}}
  54. </td>
  55. <td class="sha">
  56. <a rel="nofollow" class="ui sha label {{if .Signature}} isSigned {{if .Verification.Verified }} isVerified {{end}}{{end}}" href="{{AppSubUrl}}/{{$.Username}}/{{$.Reponame}}/commit/{{.ID}}">
  57. {{ShortSha .ID.String}}
  58. {{if .Signature}}
  59. <div class="ui detail icon button">
  60. {{if .Verification.Verified}}
  61. <i title="{{.Verification.Reason}}" class="lock green icon"></i>
  62. {{else}}
  63. <i title="{{$.i18n.Tr .Verification.Reason}}" class="unlock icon"></i>
  64. {{end}}
  65. </div>
  66. {{end}}
  67. </a>
  68. </td>
  69. <td class="message collapsing">
  70. <span class="has-emoji{{if gt .ParentCount 1}} grey text{{end}}">{{RenderCommitMessage .Summary $.RepoLink $.Repository.ComposeMetas}}</span>
  71. {{if IsMultilineCommitMessage .Message}}
  72. <button class="basic compact mini ui icon button commit-button"><i class="ellipsis horizontal icon"></i></button>
  73. <pre class="commit-body" style="display: none;">{{RenderCommitBody .Message $.RepoLink $.Repository.ComposeMetas}}</pre>
  74. {{end}}
  75. {{template "repo/commit_status" .Status}}
  76. </td>
  77. <td class="grey text right aligned">{{TimeSince .Author.When $.Lang}}</td>
  78. </tr>
  79. {{end}}
  80. </tbody>
  81. </table>
  82. </div>
  83. {{end}}
  84. {{template "base/paginate" .}}