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.

94 lines
4.0 KiB

  1. <h4 class="ui top attached header">
  2. {{.CommitCount}} {{.i18n.Tr "repo.commits.commits"}} {{if .Branch}}({{.Branch}}){{end}}
  3. {{if .PageIsCommits}}
  4. <div class="ui right">
  5. <form action="{{.RepoLink}}/commits/{{.BranchNameSubURL}}/search">
  6. <div class="ui tiny search input">
  7. <input name="q" placeholder="{{.i18n.Tr "repo.commits.search"}}" value="{{.Keyword}}" autofocus>
  8. </div>
  9. &nbsp;
  10. <div class="ui checkbox">
  11. <input type="checkbox" name="all" id="all" value="true" {{.All}}>
  12. <label for="all">{{.i18n.Tr "repo.commits.search_all"}} &nbsp;&nbsp;</label>
  13. </div>
  14. <button class="ui black tiny button" data-panel="#add-deploy-key-panel">{{.i18n.Tr "repo.commits.find"}}</button>
  15. </form>
  16. </div>
  17. {{else if .IsDiffCompare}}
  18. <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>
  19. {{end}}
  20. </h4>
  21. {{if .Commits}}
  22. <div class="ui attached table segment">
  23. <table class="ui very basic striped fixed table single line" id="commits-table">
  24. <thead>
  25. <tr>
  26. <th class="four wide">{{.i18n.Tr "repo.commits.author"}}</th>
  27. <th class="two wide sha">SHA1</th>
  28. <th class="seven wide message">{{.i18n.Tr "repo.commits.message"}}</th>
  29. <th class="three wide right aligned">{{.i18n.Tr "repo.commits.date"}}</th>
  30. </tr>
  31. </thead>
  32. <tbody>
  33. {{ $r:= List .Commits}}
  34. {{range $r}}
  35. <tr>
  36. <td class="author">
  37. {{if .User}}
  38. {{if .User.FullName}}
  39. <img class="ui avatar image" src="{{.User.RelAvatarLink}}" alt=""/>&nbsp;&nbsp;<a href="{{AppSubUrl}}/{{.User.Name}}">{{.User.FullName}}</a>
  40. {{else}}
  41. <img class="ui avatar image" src="{{.User.RelAvatarLink}}" alt=""/>&nbsp;&nbsp;<a href="{{AppSubUrl}}/{{.User.Name}}">{{.Author.Name}}</a>
  42. {{end}}
  43. {{else}}
  44. <img class="ui avatar image" src="{{AvatarLink .Author.Email}}" alt=""/>&nbsp;&nbsp;{{.Author.Name}}
  45. {{end}}
  46. </td>
  47. <td class="sha">
  48. <a rel="nofollow" class="ui sha label {{if .Signature}} isSigned {{if .Verification.Verified }} isVerified {{end}}{{end}}" href="{{AppSubUrl}}/{{$.Username}}/{{$.Reponame}}/commit/{{.ID}}">
  49. {{ShortSha .ID.String}}
  50. {{if .Signature}}
  51. <div class="ui detail icon button">
  52. {{if .Verification.Verified}}
  53. <i title="{{.Verification.Reason}}" class="lock green icon"></i>
  54. {{else}}
  55. <i title="{{$.i18n.Tr .Verification.Reason}}" class="unlock icon"></i>
  56. {{end}}
  57. </div>
  58. {{end}}
  59. </a>
  60. </td>
  61. <td class="message collapsing">
  62. <span class="has-emoji{{if gt .ParentCount 1}} grey text{{end}}">{{RenderCommitMessage .Summary $.RepoLink $.Repository.ComposeMetas}}</span>
  63. {{template "repo/commit_status" .Status}}
  64. </td>
  65. <td class="grey text right aligned">{{TimeSince .Author.When $.Lang}}</td>
  66. </tr>
  67. {{end}}
  68. </tbody>
  69. </table>
  70. </div>
  71. {{end}}
  72. {{with .Page}}
  73. {{if gt .TotalPages 1}}
  74. <div class="center page buttons">
  75. <div class="ui borderless pagination menu">
  76. <a class="{{if not .HasPrevious}}disabled{{end}} item" {{if .HasPrevious}}href="{{$.RepoLink}}/commits/{{$.BranchNameSubURL}}{{if $.FileName}}/{{$.FileName}}{{end}}?page={{.Previous}}"{{end}}>
  77. <i class="left arrow icon"></i> {{$.i18n.Tr "repo.issues.previous"}}
  78. </a>
  79. {{range .Pages}}
  80. {{if eq .Num -1}}
  81. <a class="disabled item">...</a>
  82. {{else}}
  83. <a class="{{if .IsCurrent}}active{{end}} item" {{if not .IsCurrent}}href="{{$.RepoLink}}/commits/{{$.BranchNameSubURL}}{{if $.FileName}}/{{$.FileName}}{{end}}?page={{.Num}}"{{end}}>{{.Num}}</a>
  84. {{end}}
  85. {{end}}
  86. <a class="{{if not .HasNext}}disabled{{end}} item" {{if .HasNext}}href="{{$.RepoLink}}/commits/{{$.BranchNameSubURL}}{{if $.FileName}}/{{$.FileName}}{{end}}?page={{.Next}}"{{end}}>
  87. {{$.i18n.Tr "repo.issues.next"}} <i class="icon right arrow"></i>
  88. </a>
  89. </div>
  90. </div>
  91. {{end}}
  92. {{end}}