view_list.tmpl 3.9 KiB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. {{/*
  2. {{if .LatestCommit.Author}}{{TimeSince .LatestCommit.Author.When $.Lang}}{{end}}
  3. <td class="message collapsing has-emoji">
  4. {{RenderCommitMessageLink $commit.Summary $.RepoLink (print $.RepoLink "/commit/" $commit.ID) $.Repository.ComposeMetas}}
  5. </td>
  6. */}}
  7. {{ $collapseList := and .ReadmeExist (not .HasParentPath)}}
  8. <details {{if not $collapseList}}open{{end}}>
  9. <summary class="ui top attached header">
  10. <h4 style="display: inline;" class="clearfix">
  11. {{if $collapseList}}Contents of{{end}}
  12. {{ $n := len .TreeNames}}
  13. {{ $l := Subtract $n 1}}
  14. <span class="ui breadcrumb repo-path"><a class="section" href="{{.RepoLink}}/src/{{EscapePound .BranchNameSubURL}}">{{EllipsisString .Repository.Name 30}}</a>{{range $i, $v := .TreeNames}}<span class="divider">/</span>{{if eq $i $l}}<span class="active section">{{EllipsisString $v 30}}</span>{{else}}{{ $p := index $.Paths $i}}<span class="section"><a href="{{EscapePound $.BranchLink}}/{{EscapePound $p}}">{{EllipsisString $v 30}}</a></span>{{end}}{{end}}</span>
  15. <div class="ui right sub header">
  16. Latest commit:
  17. {{template "repo/commit_status" .LatestCommitStatus}}
  18. <a rel="nofollow" href="{{.RepoLink}}/commit/{{.LatestCommit.ID}}">
  19. {{ $commitLink:= printf "%s/commit/%s" .RepoLink .LatestCommit.ID }}
  20. <span class="grey has-emoji commit-summary" title="{{.LatestCommit.Summary}}"><span class="message-wrapper">{{RenderCommitMessageLinkSubject .LatestCommit.Message $.RepoLink $commitLink $.Repository.ComposeMetas}}</span>
  21. {{if IsMultilineCommitMessage .LatestCommit.Message}}
  22. <button class="basic compact mini ui icon button commit-button"><i class="ellipsis horizontal icon"></i></button>
  23. <pre class="commit-body" style="display: none;">{{RenderCommitBody .LatestCommit.Message $.RepoLink $.Repository.ComposeMetas}}</pre>
  24. {{end}}
  25. {{template "repo/commit_status" .LatestCommitStatus}}
  26. </span>
  27. </a>
  28. <span style="margin-left: 1em;">
  29. {{if .LatestCommit.Author}}{{TimeSince .LatestCommit.Author.When $.Lang}}{{end}}
  30. </span>
  31. </div>
  32. </h4>
  33. </summary>
  34. <table id="repo-files-table" class="ui single line attached unstackable table">
  35. <tbody>
  36. {{if .HasParentPath}}
  37. <tr class="has-parent">
  38. <td colspan="2"><a href="{{EscapePound .BranchLink}}{{.ParentPath}}">{{svg "octicon-mail-reply" 16}} ..</a></td>
  39. </tr>
  40. {{end}}
  41. {{range $item := .Files}}
  42. {{$entry := index $item 0}}
  43. {{$commit := index $item 1}}
  44. <tr>
  45. {{if $entry.IsSubModule}}
  46. <td>
  47. <span class="truncate">
  48. {{svg "octicon-file-submodule" 16}}
  49. {{$refURL := $commit.RefURL AppUrl $.BranchLink}}
  50. {{if $refURL}}
  51. <a href="{{$refURL}}">{{$entry.Name}}</a> @ <a href="{{$refURL}}/commit/{{$commit.RefID}}">{{ShortSha $commit.RefID}}</a>
  52. {{else}}
  53. {{$entry.Name}} @ {{ShortSha $commit.RefID}}
  54. {{end}}
  55. </span>
  56. </td>
  57. {{else}}
  58. <td class="name">
  59. <span class="truncate">
  60. {{if $entry.IsDir}}
  61. {{$subJumpablePathName := $entry.GetSubJumpablePathName}}
  62. {{$subJumpablePath := SubJumpablePath $subJumpablePathName}}
  63. {{svg "octicon-file-directory" 16}}
  64. <a href="{{EscapePound $.TreeLink}}/{{EscapePound $subJumpablePathName}}" title="{{$subJumpablePathName}}">
  65. {{if eq (len $subJumpablePath) 2}}
  66. <span class="jumpable-path">{{index $subJumpablePath 0}}</span>{{index $subJumpablePath 1}}
  67. {{else}}
  68. {{index $subJumpablePath 0}}
  69. {{end}}
  70. </a>
  71. {{else}}
  72. {{svg (printf "octicon-%s" (EntryIcon $entry)) 16}}
  73. <a href="{{EscapePound $.TreeLink}}/{{EscapePound $entry.Name}}">{{$entry.Name}}</a>
  74. {{end}}
  75. </span>
  76. </td>
  77. {{end}}
  78. <td class="text right age">{{TimeSince $commit.Committer.When $.Lang}}</td>
  79. </tr>
  80. {{end}}
  81. </tbody>
  82. </table>
  83. </details>
  84. {{if .ReadmeExist}}
  85. {{template "repo/view_file" .}}
  86. {{end}}