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 4.8KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. <table id="repo-files-table" class="ui single line table" 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 .LatestCommitUser 24}}
  10. {{if .LatestCommitUser.FullName}}
  11. <a href="{{AppSubUrl}}/{{.LatestCommitUser.Name}}"><strong>{{.LatestCommitUser.FullName}}</strong></a>
  12. {{else}}
  13. <a href="{{AppSubUrl}}/{{.LatestCommitUser.Name}}"><strong>{{if .LatestCommit.Author}}{{.LatestCommit.Author.Name}}{{else}}{{.LatestCommitUser.Name}}{{end}}</strong></a>
  14. {{end}}
  15. {{else}}
  16. {{if .LatestCommit.Author}}
  17. {{avatarByEmail .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/{{.LatestCommit.ID}}">
  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 .LatestCommit.ID }}
  29. <span class="grey commit-summary" title="{{.LatestCommit.Summary}}"><span class="message-wrapper">{{RenderCommitMessageLinkSubject .LatestCommit.Message $.RepoLink $commitLink $.Repository.ComposeMetas}}</span>
  30. {{if IsMultilineCommitMessage .LatestCommit.Message}}
  31. <button class="basic compact mini ui icon button commit-button"><i class="ellipsis horizontal icon"></i></button>
  32. <pre class="commit-body" style="display: none;">{{RenderCommitBody .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.Author}}{{TimeSince .LatestCommit.Author.When $.Lang}}{{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="{{EscapePound .BranchLink}}{{.ParentPath}}">..</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}}
  56. {{if $refURL}}
  57. <a href="{{$refURL}}">{{$entry.Name}}</a><span class="at">@</span><a href="{{$refURL}}/commit/{{$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"}}
  66. <a href="{{EscapePound $.TreeLink}}/{{EscapePound $subJumpablePathName}}" title="{{$subJumpablePathName}}">
  67. {{if eq (len $subJumpablePath) 2}}
  68. <span class="jumpable-path">{{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 href="{{EscapePound $.TreeLink}}/{{EscapePound $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. <a href="{{$.RepoLink}}/commit/{{$commit.ID}}" title="{{$commit.Summary}}">{{$commit.Summary | RenderEmoji}}</a>
  84. {{else}}
  85. <div class="ui active tiny slow centered inline">…</div>
  86. {{end}}
  87. </span>
  88. </td>
  89. <td class="text right age three wide">{{if $commit}}{{TimeSince $commit.Committer.When $.Lang}}{{end}}</td>
  90. </tr>
  91. {{end}}
  92. </tbody>
  93. </table>
  94. {{if .ReadmeExist}}
  95. {{template "repo/view_file" .}}
  96. {{end}}