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.6KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  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. {{ctx.AvatarUtils.Avatar .LatestCommitUser 24 "gt-mr-2"}}
  10. {{if .LatestCommitUser.FullName}}
  11. <a class="muted author-wrapper" title="{{.LatestCommitUser.FullName}}" href="{{.LatestCommitUser.HomeLink}}"><strong>{{.LatestCommitUser.FullName}}</strong></a>
  12. {{else}}
  13. <a class="muted author-wrapper" title="{{if .LatestCommit.Author}}{{.LatestCommit.Author.Name}}{{else}}{{.LatestCommitUser.Name}}{{end}}" 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. {{ctx.AvatarUtils.AvatarByEmail .LatestCommit.Author.Email .LatestCommit.Author.Name 24 "gt-mr-2"}}
  18. <span class="author-wrapper" title="{{.LatestCommit.Author.Name}}"><strong>{{.LatestCommit.Author.Name}}</strong></span>
  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 js-toggle-commit-body 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 ctx.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 class="muted" 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. {{svg "octicon-file-directory-fill"}}
  65. <a class="muted" href="{{$.TreeLink}}/{{PathEscapeSegments $subJumpablePathName}}" title="{{$subJumpablePathName}}">
  66. {{$subJumpablePathFields := StringUtils.Split $subJumpablePathName "/"}}
  67. {{$subJumpablePathFieldLast := (Eval (len $subJumpablePathFields) "-" 1)}}
  68. {{if eq $subJumpablePathFieldLast 0}}
  69. {{$subJumpablePathName}}
  70. {{else}}
  71. {{$subJumpablePathPrefixes := slice $subJumpablePathFields 0 $subJumpablePathFieldLast}}
  72. <span class="text light-2">{{StringUtils.Join $subJumpablePathPrefixes "/"}}</span>/{{index $subJumpablePathFields $subJumpablePathFieldLast}}
  73. {{end}}
  74. </a>
  75. {{else}}
  76. {{svg (printf "octicon-%s" (EntryIcon $entry))}}
  77. <a class="muted" href="{{$.TreeLink}}/{{PathEscapeSegments $entry.Name}}" title="{{$entry.Name}}">{{$entry.Name}}</a>
  78. {{end}}
  79. {{end}}
  80. </span>
  81. </td>
  82. <td class="message nine wide">
  83. <span class="truncate">
  84. {{if $commit}}
  85. {{$commitLink := printf "%s/commit/%s" $.RepoLink (PathEscape $commit.ID.String)}}
  86. {{RenderCommitMessageLinkSubject $.Context $commit.Message $.RepoLink $commitLink $.Repository.ComposeMetas}}
  87. {{else}}
  88. <div class="ui active tiny slow centered inline">…</div>
  89. {{end}}
  90. </span>
  91. </td>
  92. <td class="text right age three wide">{{if $commit}}{{TimeSince $commit.Committer.When ctx.Locale}}{{end}}</td>
  93. </tr>
  94. {{end}}
  95. </tbody>
  96. </table>
  97. {{if .ReadmeExist}}
  98. {{template "repo/view_file" .}}
  99. {{end}}