view_list.tmpl 3.0 KB

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