view_list.tmpl 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. <table id="repo-files-table" class="ui unstackable fixed single line table">
  2. <thead>
  3. <tr>
  4. <th class="four wide">
  5. {{if .LatestCommitUser}}
  6. <img class="ui avatar image img-12" src="{{.LatestCommitUser.RelAvatarLink}}" />
  7. <a href="{{AppSubURL}}/{{.LatestCommitUser.Name}}"><strong>{{.LatestCommit.Author.Name}}</strong></a>
  8. {{else}}
  9. <img class="ui avatar image img-12" src="{{AvatarLink .LatestCommit.Author.Email}}" />
  10. <strong>{{.LatestCommit.Author.Name}}</strong>
  11. {{end}}
  12. <a rel="nofollow" class="ui sha label" href="{{.RepoLink}}/commit/{{.LatestCommit.ID}}" rel="nofollow">{{ShortSHA1 .LatestCommit.ID.String}}</a>
  13. <span class="grey has-emoji">{{RenderCommitMessage false .LatestCommit.Summary .RepoLink $.Repository.ComposeMetas | Str2HTML}}</span>
  14. </th>
  15. <th class="nine wide">
  16. </th>
  17. <th class="three wide text grey right age">{{TimeSince .LatestCommit.Author.When $.Lang}}</th>
  18. </tr>
  19. </thead>
  20. <tbody>
  21. {{if .HasParentPath}}
  22. <tr class="has-parent">
  23. <td colspan="3"><i class="octicon octicon-mail-reply"></i><a href="{{EscapePound .BranchLink}}{{.ParentPath}}">..</a></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>
  32. <span class="octicon octicon-file-submodule"></span>
  33. {{$refURL := $commit.RefURL AppURL $.BranchLink}}
  34. {{if $refURL}}
  35. <a href="{{$refURL}}">{{$entry.Name}}</a> @ <a href="{{$refURL}}/commit/{{$commit.RefID}}">{{ShortSHA1 $commit.RefID}}</a>
  36. {{else}}
  37. {{$entry.Name}} @ {{ShortSHA1 $commit.RefID}}
  38. {{end}}
  39. </td>
  40. {{else}}
  41. <td class="name">
  42. {{if $entry.IsLink}}
  43. <span class="octicon octicon-file-symlink-file"></span>
  44. {{else}}
  45. <span class="octicon octicon-file-{{if or $entry.IsDir}}directory{{else}}text{{end}}"></span>
  46. {{end}}
  47. <a href="{{EscapePound $.TreeLink}}/{{EscapePound $entry.Name}}">{{$entry.Name}}</a>
  48. </td>
  49. {{end}}
  50. <td class="message collapsing has-emoji">
  51. <a rel="nofollow" class="ui sha label" href="{{$.RepoLink}}/commit/{{$commit.ID}}">{{ShortSHA1 $commit.ID.String}}</a>
  52. {{RenderCommitMessage false $commit.Summary $.RepoLink $.Repository.ComposeMetas | Str2HTML}}
  53. </td>
  54. <td class="text grey right age">{{TimeSince $commit.Committer.When $.Lang}}</td>
  55. </tr>
  56. {{end}}
  57. </tbody>
  58. </table>
  59. {{if and .ReadmeExist .IsTextFile}}
  60. {{template "repo/view_file" .}}
  61. {{end}}