commits_table.tmpl 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. <div id="commits">
  2. <div class="panel panel-default commit-box info-box">
  3. <div class="panel-heading info-head">
  4. <form class="search pull-right col-md-3" action="{{.RepoLink}}/commits/{{.BranchName}}/search" method="get" id="commits-search-form">
  5. <div class="input-group">
  6. <input class="form-control search" type="search" placeholder="search commit" name="q" value="{{.Keyword}}" />
  7. <div class="input-group-btn">
  8. <button type="submit" class="btn btn-default">Find</button>
  9. </div>
  10. </div>
  11. </form>
  12. <h4>{{.CommitCount}} Commits</h4>
  13. </div>
  14. <table class="panel-footer table commit-list table table-striped">
  15. <thead>
  16. <tr>
  17. <th class="author">Author</th>
  18. <th class="sha">SHA1</th>
  19. <th class="message">Message</th>
  20. <th class="date">Date</th>
  21. </tr>
  22. </thead>
  23. <tbody>
  24. {{ $username := .Username}}
  25. {{ $reponame := .Reponame}}
  26. {{$r := List .Commits}}
  27. {{range $r}}
  28. <tr>
  29. <td class="author"><img class="avatar" src="{{AvatarLink .Author.Email}}" alt=""/><a href="/user/email2user?email={{.Author.Email}}">{{.Author.Name}}</a></td>
  30. <td class="sha"><a rel="nofollow" class="label label-success" href="/{{$username}}/{{$reponame}}/commit/{{.Id}} ">{{SubStr .Id.String 0 10}} </a></td>
  31. <td class="message">{{.Summary}} </td>
  32. <td class="date">{{TimeSince .Author.When $.Lang}}</td>
  33. </tr>
  34. {{end}}
  35. </tbody>
  36. </table>
  37. </div>
  38. {{if not .IsSearchPage}}<ul class="pagination" id="commits-pager">
  39. {{if .LastPageNum}}<li><a href="{{.RepoLink}}/commits/{{.BranchName}}{{if .FileName}}/{{.FileName}}{{end}}?p={{.LastPageNum}}" rel="nofollow">&laquo; Newer</a></li>{{end}}
  40. {{if .NextPageNum}}<li><a href="{{.RepoLink}}/commits/{{.BranchName}}{{if .FileName}}/{{.FileName}}{{end}}?p={{.NextPageNum}}" rel="nofollow">&raquo; Older</a></li>{{end}}
  41. </ul>{{end}}
  42. </div>