view_list.tmpl 2.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  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. <a href="{{$commit.RefUrl}}" class="text-truncate">{{$entry.Name}}</a> @ <a href="{{$commit.RefUrl}}/commit/{{$commit.RefId}}">{{ShortSha $commit.RefId}}</a>
  43. </td>
  44. {{else}}
  45. <td class="icon">
  46. <span class="octicon octicon-file-{{if or $entry.IsDir}}directory{{else}}text{{end}}"></span>
  47. </td>
  48. <td class="name">
  49. <a href="{{EscapePound $.BranchLink}}/{{$.TreePath}}{{$entry.Name}}" class="text-truncate">{{$entry.Name}}</a>
  50. </td>
  51. {{end}}
  52. <td class="sha">
  53. <a rel="nofollow" class="label label-green" href="{{AppSubUrl}}/{{$.Username}}/{{$.Reponame}}/commit/{{$commit.Id}} ">{{SubStr $commit.Id.String 0 10}} </a>
  54. </td>
  55. <td class="message">
  56. <span class="text-truncate">{{RenderCommitMessage $commit.Summary $.RepoLink}}</span>
  57. </td>
  58. <td class="age">{{TimeSince $commit.Committer.When $.Lang}}</td>
  59. </tr>
  60. {{end}}
  61. </tbody>
  62. </table>
  63. {{if .ReadmeExist}}
  64. {{template "repo/view_file" .}}
  65. {{end}}