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.

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