commits_table.tmpl 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. <div id="commits-list">
  2. <div class="panel panel-radius">
  3. <div class="panel-header">
  4. {{if not .IsDiffCompare}}
  5. <form class="search pull-right" action="{{.RepoLink}}/commits/{{.BranchName}}/search" method="get" id="commits-search-form">
  6. <input class="ipt ipt-radius" type="search" name="q" placeholder="{{.i18n.Tr "repo.commits.search"}}" value="{{.Keyword}}" />
  7. <button class="btn btn-black btn-small btn-radius">{{.i18n.Tr "repo.commits.find"}}</button>
  8. </form>
  9. {{end}}
  10. <h4>{{.CommitCount}} {{.i18n.Tr "repo.commits.commits"}}</h4>
  11. </div>
  12. <table class="panel-body table commit-list table-striped">
  13. <thead>
  14. <tr>
  15. <th class="author">{{.i18n.Tr "repo.commits.author"}}</th>
  16. <th class="sha">SHA1</th>
  17. <th class="message">{{.i18n.Tr "repo.commits.message"}}</th>
  18. <th class="date">{{.i18n.Tr "repo.commits.date"}}</th>
  19. </tr>
  20. </thead>
  21. <tbody>
  22. {{ $username := .Username}}
  23. {{ $reponame := .Reponame}}
  24. {{$r := List .Commits}}
  25. {{range $r}}
  26. <tr>
  27. <td class="author"><img class="avatar-20" src="{{AvatarLink .Author.Email}}" alt=""/>&nbsp;&nbsp;&nbsp;{{if .UserName}}<a href="{{AppSubUrl}}/{{.UserName}}">{{.Author.Name}}</a>{{else}}{{.Author.Name}}{{end}}</td>
  28. <td class="sha"><a rel="nofollow" class="label label-green" href="{{AppSubUrl}}/{{$username}}/{{$reponame}}/commit/{{.Id}} ">{{SubStr .Id.String 0 10}} </a></td>
  29. <td class="message"><span class="text-truncate">{{.Summary}}</span></td>
  30. <td class="date">{{TimeSince .Author.When $.Lang}}</td>
  31. </tr>
  32. {{end}}
  33. </tbody>
  34. </table>
  35. </div>
  36. {{if and (not .IsSearchPage) (not .IsDiffCompare)}}
  37. <ul class="pagination">
  38. {{if .LastPageNum}}<li><a class="btn btn-medium btn-gray btn-radius" href="{{.RepoLink}}/commits/{{.BranchName}}{{if .FileName}}/{{.FileName}}{{end}}?p={{.LastPageNum}}" rel="nofollow">&laquo; {{.i18n.Tr "repo.commits.newer"}}</a></li>{{end}}
  39. {{if .NextPageNum}}<li><a class="btn btn-medium btn-gray btn-radius" href="{{.RepoLink}}/commits/{{.BranchName}}{{if .FileName}}/{{.FileName}}{{end}}?p={{.NextPageNum}}" rel="nofollow">&raquo; {{.i18n.Tr "repo.commits.older"}}</a></li>{{end}}
  40. </ul>
  41. {{end}}
  42. </div>