本站源代码
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.

103 lines
4.8KB

  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 {{else if .Verification.Warning}} isWarning {{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. {{if ne .Verification.SigningUser.ID 0}}
  64. <i title="{{.Verification.Reason}}" class="lock green icon"></i>
  65. {{else}}
  66. <i title="{{.Verification.Reason}}" class="icons">
  67. <i class="green lock icon"></i>
  68. <i class="tiny inverted cog icon centerlock"></i>
  69. </i>
  70. {{end}}
  71. {{else if .Verification.Warning}}
  72. <i title="{{$.i18n.Tr .Verification.Reason}}" class="red unlock icon"></i>
  73. {{else}}
  74. <i title="{{$.i18n.Tr .Verification.Reason}}" class="unlock icon"></i>
  75. {{end}}
  76. </div>
  77. {{end}}
  78. </a>
  79. </td>
  80. <td class="message">
  81. <span class="message-wrapper">
  82. {{ $commitLink:= printf "%s/%s/%s/commit/%s" AppSubUrl $.Username $.Reponame .ID }}
  83. <span class="commit-summary has-emoji{{if gt .ParentCount 1}} grey text{{end}}" title="{{.Summary}}">{{RenderCommitMessageLinkSubject .Message $.RepoLink $commitLink $.Repository.ComposeMetas}}</span>
  84. </span>
  85. {{if IsMultilineCommitMessage .Message}}
  86. <button class="basic compact mini ui icon button commit-button"><i class="ellipsis horizontal icon"></i></button>
  87. {{end}}
  88. {{template "repo/commit_status" .Status}}
  89. {{if IsMultilineCommitMessage .Message}}
  90. <pre class="commit-body" style="display: none;">{{RenderCommitBody .Message $.RepoLink $.Repository.ComposeMetas}}</pre>
  91. {{end}}
  92. </td>
  93. <td class="grey text right aligned">{{TimeSince .Author.When $.Lang}}</td>
  94. </tr>
  95. {{end}}
  96. </tbody>
  97. </table>
  98. </div>
  99. {{end}}
  100. {{template "base/paginate" .}}
上海开阖软件有限公司 沪ICP备12045867号-1