view_list.tmpl 2.6 KB

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