view_list.tmpl 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. <table id="repo-files-table" class="table-border table-block table-radius">
  2. <thead>
  3. <tr>
  4. <th colspan="4" class="clear">
  5. <span class="author left">
  6. <img class="avatar-24 radius" src="{{AvatarLink .LastCommit.Author.Email}}" />
  7. {{if .LastCommitUser}}<a href="{{AppSubUrl}}/{{.LastCommitUser}}">{{end}}<strong>{{.LastCommit.Author.Name}}</strong>:{{if .LastCommitUser}}</a>{{end}}
  8. </span>
  9. <span class="last-commit"><a href="{{.RepoLink}}/commit/{{.LastCommit.Id}}" rel="nofollow">
  10. <strong>{{ShortSha .LastCommit.Id.String}}</strong></a>
  11. <span class="text-truncate">{{.LastCommit.Summary}}</span>
  12. </span>
  13. <span class="age right">{{TimeSince .LastCommit.Author.When $.Lang}}</span>
  14. </th>
  15. </tr>
  16. </thead>
  17. <tbody>
  18. {{if .HasParentPath}}
  19. <tr class="has-parent">
  20. <td class="icon"></td>
  21. <td class="name"><a href="{{.BranchLink}}{{.ParentPath}}">..</a></td>
  22. <td class="msg"></td>
  23. <td class="age"></td>
  24. </tr>
  25. {{end}}
  26. {{range $item := .Files}}
  27. {{$entry := index $item 0}}
  28. {{$commit := index $item 1}}
  29. <tr>
  30. {{if $entry.IsSubModule}}
  31. <td class="icon">
  32. <span class="octicon octicon-file-submodule"></span>
  33. </td>
  34. <td class="name">
  35. <a href="{{$commit.RefUrl}}" class="text-truncate">{{$entry.Name}}</a> @ <a href="{{$commit.RefUrl}}/commit/{{$commit.RefId}}">{{ShortSha $commit.RefId}}</a>
  36. </td>
  37. {{else}}
  38. <td class="icon">
  39. <span class="octicon octicon-file-{{if or $entry.IsDir}}directory{{else}}text{{end}}"></span>
  40. </td>
  41. <td class="name">
  42. <a href="{{$.BranchLink}}/{{$.TreePath}}{{$entry.Name}}" class="text-truncate">{{$entry.Name}}</a>
  43. </td>
  44. {{end}}
  45. <td class="msg">
  46. <a class="text-truncate" href="{{AppSubUrl}}/{{$.Username}}/{{$.Reponame}}/commit/{{$commit.Id}}" rel="nofollow">{{$commit.Summary}}</a>
  47. </td>
  48. <td class="age">{{TimeSince $commit.Committer.When $.Lang}}</td>
  49. </tr>
  50. {{end}}
  51. </tbody>
  52. </table>
  53. {{if .ReadmeExist}}
  54. {{template "repo/view_file" .}}
  55. {{end}}