You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

commits_table.tmpl 3.0 kB

10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  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. <button class="ui black tiny button" data-panel="#add-deploy-key-panel">{{.i18n.Tr "repo.commits.find"}}</button>
  10. </form>
  11. </div>
  12. {{else if .IsDiffCompare}}
  13. <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>
  14. {{end}}
  15. </h4>
  16. {{if .Commits}}
  17. <div class="ui attached table segment">
  18. <table class="ui very basic striped commits table">
  19. <thead>
  20. <tr>
  21. <th>{{.i18n.Tr "repo.commits.author"}}</th>
  22. <th>SHA1</th>
  23. <th>{{.i18n.Tr "repo.commits.message"}}</th>
  24. <th>{{.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. <img class="ui avatar image" src="{{.User.AvatarLink}}" alt=""/>&nbsp;&nbsp;<a href="{{AppSubUrl}}/{{.User.Name}}">{{.Author.Name}}</a>
  34. {{else}}
  35. <img class="ui avatar image" src="{{AvatarLink .Author.Email}}" alt=""/>&nbsp;&nbsp;{{.Author.Name}}
  36. {{end}}
  37. </td>
  38. <td class="sha"><a rel="nofollow" class="ui green sha label" href="{{AppSubUrl}}/{{$.Username}}/{{$.Reponame}}/commit/{{.ID}} ">{{SubStr .ID.String 0 10}} </a></td>
  39. <td class="message"><span class="text truncate">{{RenderCommitMessage .Summary $.RepoLink}}</span></td>
  40. <td class="date">{{TimeSince .Author.When $.Lang}}</td>
  41. </tr>
  42. {{end}}
  43. </tbody>
  44. </table>
  45. </div>
  46. {{end}}
  47. {{with .Page}}
  48. {{if gt .TotalPages 1}}
  49. <div class="center page buttons">
  50. <div class="ui borderless pagination menu">
  51. <a class="{{if not .HasPrevious}}disabled{{end}} item" {{if .HasPrevious}}href="{{$.RepoLink}}/commits/{{$.BranchName}}{{if $.FileName}}/{{$.FileName}}{{end}}?page={{.Previous}}"{{end}}>
  52. <i class="left arrow icon"></i> {{$.i18n.Tr "repo.issues.previous"}}
  53. </a>
  54. {{range .Pages}}
  55. {{if eq .Num -1}}
  56. <a class="disabled item">...</a>
  57. {{else}}
  58. <a class="{{if .IsCurrent}}active{{end}} item" {{if not .IsCurrent}}href="{{$.RepoLink}}/commits/{{$.BranchName}}{{if $.FileName}}/{{$.FileName}}{{end}}?page={{.Num}}"{{end}}>{{.Num}}</a>
  59. {{end}}
  60. {{end}}
  61. <a class="{{if not .HasNext}}disabled{{end}} item" {{if .HasNext}}href="{{$.RepoLink}}/commits/{{$.BranchName}}{{if $.FileName}}/{{$.FileName}}{{end}}?page={{.Next}}"{{end}}>
  62. {{$.i18n.Tr "repo.issues.next"}} <i class="icon right arrow"></i>
  63. </a>
  64. </div>
  65. </div>
  66. {{end}}
  67. {{end}}