commits_table.tmpl 2.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  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">
  28. {{if .User}}
  29. <img class="avatar-20" src="{{.User.AvatarLink}}" alt=""/>&nbsp;&nbsp;&nbsp;<a href="{{AppSubUrl}}/{{.User.Name}}">{{.Author.Name}}</a>
  30. {{else}}
  31. <img class="avatar-20" src="{{AvatarLink .Author.Email}}" alt=""/>&nbsp;&nbsp;&nbsp;{{.Author.Name}}
  32. {{end}}
  33. </td>
  34. <td class="sha"><a rel="nofollow" class="label label-green" href="{{AppSubUrl}}/{{$username}}/{{$reponame}}/commit/{{.Id}} ">{{SubStr .Id.String 0 10}} </a></td>
  35. <td class="message"><span class="text-truncate">{{RenderCommitMessage .Summary $.RepoLink}}</span></td>
  36. <td class="date">{{TimeSince .Author.When $.Lang}}</td>
  37. </tr>
  38. {{end}}
  39. </tbody>
  40. </table>
  41. </div>
  42. {{if and (not .IsSearchPage) (not .IsDiffCompare)}}
  43. <ul class="pagination">
  44. {{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}}
  45. {{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}}
  46. </ul>
  47. {{end}}
  48. </div>