You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

view_list.tmpl 5.1KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. <table id="repo-files-table" class="ui single line table gt-mt-0" data-last-commit-loader-url="{{.LastCommitLoaderURL}}">
  2. <thead>
  3. <tr class="commit-list">
  4. <th colspan="2" {{if not .LatestCommit}}class="notready"{{end}}>
  5. {{if not .LatestCommit}}
  6. <div class="ui active tiny slow centered inline">…</div>
  7. {{else}}
  8. {{if .LatestCommitUser}}
  9. {{avatar $.Context .LatestCommitUser 24}}
  10. {{if .LatestCommitUser.FullName}}
  11. <a class="muted" href="{{.LatestCommitUser.HomeLink}}"><strong>{{.LatestCommitUser.FullName}}</strong></a>
  12. {{else}}
  13. <a class="muted" href="{{.LatestCommitUser.HomeLink}}"><strong>{{if .LatestCommit.Author}}{{.LatestCommit.Author.Name}}{{else}}{{.LatestCommitUser.Name}}{{end}}</strong></a>
  14. {{end}}
  15. {{else}}
  16. {{if .LatestCommit.Author}}
  17. {{avatarByEmail $.Context .LatestCommit.Author.Email .LatestCommit.Author.Name 24}}
  18. <strong>{{.LatestCommit.Author.Name}}</strong>
  19. {{end}}
  20. {{end}}
  21. <a rel="nofollow" class="ui sha label {{if .LatestCommit.Signature}} isSigned {{if .LatestCommitVerification.Verified}} isVerified{{if eq .LatestCommitVerification.TrustStatus "trusted"}}{{else if eq .LatestCommitVerification.TrustStatus "untrusted"}}Untrusted{{else}}Unmatched{{end}}{{else if .LatestCommitVerification.Warning}} isWarning{{end}}{{end}}" href="{{.RepoLink}}/commit/{{PathEscape .LatestCommit.ID.String}}">
  22. <span class="shortsha">{{ShortSha .LatestCommit.ID.String}}</span>
  23. {{if .LatestCommit.Signature}}
  24. {{template "repo/shabox_badge" dict "root" $ "verification" .LatestCommitVerification}}
  25. {{end}}
  26. </a>
  27. {{template "repo/commit_statuses" dict "Status" .LatestCommitStatus "Statuses" .LatestCommitStatuses "root" $}}
  28. {{$commitLink:= printf "%s/commit/%s" .RepoLink (PathEscape .LatestCommit.ID.String)}}
  29. <span class="grey commit-summary" title="{{.LatestCommit.Summary}}"><span class="message-wrapper">{{RenderCommitMessageLinkSubject $.Context .LatestCommit.Message $.RepoLink $commitLink $.Repository.ComposeMetas}}</span>
  30. {{if IsMultilineCommitMessage .LatestCommit.Message}}
  31. <button class="ui button ellipsis-button" aria-expanded="false">...</button>
  32. <pre class="commit-body gt-hidden">{{RenderCommitBody $.Context .LatestCommit.Message $.RepoLink $.Repository.ComposeMetas}}</pre>
  33. {{end}}
  34. </span>
  35. {{end}}
  36. </th>
  37. <th class="text grey right age">{{if .LatestCommit}}{{if .LatestCommit.Committer}}{{TimeSince .LatestCommit.Committer.When $.locale}}{{end}}{{end}}</th>
  38. </tr>
  39. </thead>
  40. <tbody>
  41. {{if .HasParentPath}}
  42. <tr class="has-parent">
  43. <td colspan="3">{{svg "octicon-reply"}}<a href="{{.BranchLink}}{{if .ParentPath}}{{PathEscapeSegments .ParentPath}}{{end}}">..</a></td>
  44. </tr>
  45. {{end}}
  46. {{range $item := .Files}}
  47. {{$entry := $item.Entry}}
  48. {{$commit := $item.Commit}}
  49. {{$subModuleFile := $item.SubModuleFile}}
  50. <tr data-entryname="{{$entry.Name}}" data-ready="{{if $commit}}true{{else}}false{{end}}" class="{{if not $commit}}not{{end}}ready entry">
  51. <td class="name four wide">
  52. <span class="truncate">
  53. {{if $entry.IsSubModule}}
  54. {{svg "octicon-file-submodule"}}
  55. {{$refURL := $subModuleFile.RefURL AppUrl $.Repository.FullName $.SSHDomain}} {{/* FIXME: the usage of AppUrl seems incorrect, it would be fixed in the future, use AppSubUrl instead */}}
  56. {{if $refURL}}
  57. <a class="muted" href="{{$refURL}}">{{$entry.Name}}</a><span class="at">@</span><a href="{{$refURL}}/commit/{{PathEscape $subModuleFile.RefID}}">{{ShortSha $subModuleFile.RefID}}</a>
  58. {{else}}
  59. {{$entry.Name}}<span class="at">@</span>{{ShortSha $subModuleFile.RefID}}
  60. {{end}}
  61. {{else}}
  62. {{if $entry.IsDir}}
  63. {{$subJumpablePathName := $entry.GetSubJumpablePathName}}
  64. {{$subJumpablePath := SubJumpablePath $subJumpablePathName}}
  65. {{svg "octicon-file-directory-fill"}}
  66. <a class="muted" href="{{$.TreeLink}}/{{PathEscapeSegments $subJumpablePathName}}" title="{{$subJumpablePathName}}">
  67. {{if eq (len $subJumpablePath) 2}}
  68. <span class="color-text-light-2">{{index $subJumpablePath 0}}</span>{{index $subJumpablePath 1}}
  69. {{else}}
  70. {{index $subJumpablePath 0}}
  71. {{end}}
  72. </a>
  73. {{else}}
  74. {{svg (printf "octicon-%s" (EntryIcon $entry))}}
  75. <a class="muted" href="{{$.TreeLink}}/{{PathEscapeSegments $entry.Name}}" title="{{$entry.Name}}">{{$entry.Name}}</a>
  76. {{end}}
  77. {{end}}
  78. </span>
  79. </td>
  80. <td class="message nine wide">
  81. <span class="truncate">
  82. {{if $commit}}
  83. {{$commitLink := printf "%s/commit/%s" $.RepoLink (PathEscape $commit.ID.String)}}
  84. {{RenderCommitMessageLinkSubject $.Context $commit.Message $.RepoLink $commitLink $.Repository.ComposeMetas}}
  85. {{else}}
  86. <div class="ui active tiny slow centered inline">…</div>
  87. {{end}}
  88. </span>
  89. </td>
  90. <td class="text right age three wide">{{if $commit}}{{TimeSince $commit.Committer.When $.locale}}{{end}}</td>
  91. </tr>
  92. {{end}}
  93. </tbody>
  94. </table>
  95. {{if .ReadmeExist}}
  96. {{template "repo/view_file" .}}
  97. {{end}}