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.

87 lines
4.2 KiB

  1. <table id="repo-files-table" class="ui single line table">
  2. <thead>
  3. <tr class="commit-list">
  4. <th colspan="2">
  5. {{if .LatestCommitUser}}
  6. <img class="ui avatar image img-12" src="{{.LatestCommitUser.RelAvatarLink}}" />
  7. {{if .LatestCommitUser.FullName}}
  8. <a href="{{AppSubUrl}}/{{.LatestCommitUser.Name}}"><strong>{{.LatestCommitUser.FullName}}</strong></a>
  9. {{else}}
  10. <a href="{{AppSubUrl}}/{{.LatestCommitUser.Name}}"><strong>{{if .LatestCommit.Author}}{{.LatestCommit.Author.Name}}{{else}}{{.LatestCommitUser.Name}}{{end}}</strong></a>
  11. {{end}}
  12. {{else}}
  13. {{if .LatestCommit.Author}}
  14. <img class="ui avatar image img-12" src="{{AvatarLink .LatestCommit.Author.Email}}" />
  15. <strong>{{.LatestCommit.Author.Name}}</strong>
  16. {{end}}
  17. {{end}}
  18. <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}}">
  19. <span class="shortsha">{{ShortSha .LatestCommit.ID.String}}</span>
  20. {{if .LatestCommit.Signature}}
  21. {{template "repo/shabox_badge" dict "root" $ "verification" .LatestCommitVerification}}
  22. {{end}}
  23. </a>
  24. {{template "repo/commit_status" .LatestCommitStatus}}
  25. {{ $commitLink:= printf "%s/commit/%s" .RepoLink .LatestCommit.ID }}
  26. <span class="grey commit-summary" title="{{.LatestCommit.Summary}}"><span class="message-wrapper">{{RenderCommitMessageLinkSubject .LatestCommit.Message $.RepoLink $commitLink $.Repository.ComposeMetas}}</span>
  27. {{if IsMultilineCommitMessage .LatestCommit.Message}}
  28. <button class="basic compact mini ui icon button commit-button"><i class="ellipsis horizontal icon"></i></button>
  29. <pre class="commit-body" style="display: none;">{{RenderCommitBody .LatestCommit.Message $.RepoLink $.Repository.ComposeMetas}}</pre>
  30. {{end}}
  31. </span>
  32. </th>
  33. <th class="text grey right age">{{if .LatestCommit.Author}}{{TimeSince .LatestCommit.Author.When $.Lang}}{{end}}</th>
  34. </tr>
  35. </thead>
  36. <tbody>
  37. {{if .HasParentPath}}
  38. <tr class="has-parent">
  39. <td colspan="3">{{svg "octicon-reply"}}<a href="{{EscapePound .BranchLink}}{{.ParentPath}}">..</a></td>
  40. </tr>
  41. {{end}}
  42. {{range $item := .Files}}
  43. {{$entry := index $item 0}}
  44. {{$commit := index $item 1}}
  45. <tr>
  46. <td class="name four wide">
  47. <span class="truncate">
  48. {{if $entry.IsSubModule}}
  49. {{svg "octicon-file-submodule"}}
  50. {{$refURL := $commit.RefURL AppUrl $.Repository.FullName $.SSHDomain}}
  51. {{if $refURL}}
  52. <a href="{{$refURL}}">{{$entry.Name}}</a><span class="at">@</span><a href="{{$refURL}}/commit/{{$commit.RefID}}">{{ShortSha $commit.RefID}}</a>
  53. {{else}}
  54. {{$entry.Name}}<span class="at">@</span>{{ShortSha $commit.RefID}}
  55. {{end}}
  56. {{else}}
  57. {{if $entry.IsDir}}
  58. {{$subJumpablePathName := $entry.GetSubJumpablePathName}}
  59. {{$subJumpablePath := SubJumpablePath $subJumpablePathName}}
  60. {{svg "octicon-file-directory"}}
  61. <a href="{{EscapePound $.TreeLink}}/{{EscapePound $subJumpablePathName}}" title="{{$subJumpablePathName}}">
  62. {{if eq (len $subJumpablePath) 2}}
  63. <span class="jumpable-path">{{index $subJumpablePath 0}}</span>{{index $subJumpablePath 1}}
  64. {{else}}
  65. {{index $subJumpablePath 0}}
  66. {{end}}
  67. </a>
  68. {{else}}
  69. {{svg (printf "octicon-%s" (EntryIcon $entry))}}
  70. <a href="{{EscapePound $.TreeLink}}/{{EscapePound $entry.Name}}" title="{{$entry.Name}}">{{$entry.Name}}</a>
  71. {{end}}
  72. {{end}}
  73. </span>
  74. </td>
  75. <td class="message nine wide">
  76. <span class="truncate">
  77. <a href="{{$.RepoLink}}/commit/{{$commit.ID}}" title="{{$commit.Summary}}">{{$commit.Summary | RenderEmoji}}</a>
  78. </span>
  79. </td>
  80. <td class="text right age three wide">{{TimeSince $commit.Committer.When $.Lang}}</td>
  81. </tr>
  82. {{end}}
  83. </tbody>
  84. </table>
  85. {{if .ReadmeExist}}
  86. {{template "repo/view_file" .}}
  87. {{end}}