gitea源码

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. {{/* use grid layout, still use the old ID because there are many other CSS styles depending on this ID */}}
  2. <div id="repo-files-table" {{if .HasFilesWithoutLatestCommit}}hx-indicator="#repo-files-table .repo-file-cell.message" hx-trigger="load" hx-swap="morph" hx-post="{{.LastCommitLoaderURL}}"{{end}}>
  3. <div class="repo-file-line repo-file-last-commit">
  4. {{template "repo/latest_commit" .}}
  5. <div>{{if and .LatestCommit .LatestCommit.Committer}}{{DateUtils.TimeSince .LatestCommit.Committer.When}}{{end}}</div>
  6. </div>
  7. {{$.FileIconPoolHTML}}
  8. {{if .HasParentPath}}
  9. <a class="repo-file-line parent-link silenced" href="{{.BranchLink}}{{if .ParentPath}}{{PathEscapeSegments .ParentPath}}{{end}}">
  10. {{index $.FileIcons ".."}} ..
  11. </a>
  12. {{end}}
  13. {{range $item := .Files}}
  14. <div class="repo-file-item">
  15. {{$entry := $item.Entry}}
  16. {{$commit := $item.Commit}}
  17. {{$submoduleFile := $item.SubmoduleFile}}
  18. <div class="repo-file-cell name muted-links {{if not $commit}}notready{{end}}">
  19. {{index $.FileIcons $entry.Name}}
  20. {{if $entry.IsSubModule}}
  21. {{$submoduleLink := $submoduleFile.SubmoduleWebLinkTree ctx}}
  22. {{if $submoduleLink}}
  23. <a class="entry-name" href="{{$submoduleLink.RepoWebLink}}" title="{{$entry.Name}}">{{$entry.Name}}</a>
  24. @ <a class="text primary" href="{{$submoduleLink.CommitWebLink}}">{{ShortSha $submoduleFile.RefID}}</a>
  25. {{else}}
  26. <span class="entry-name" title="{{$entry.Name}}">{{$entry.Name}}</span>
  27. @ {{ShortSha $submoduleFile.RefID}}
  28. {{end}}
  29. {{else}}
  30. {{if $entry.IsDir}}
  31. {{$subJumpablePathName := $entry.GetSubJumpablePathName}}
  32. <a class="entry-name" href="{{$.TreeLink}}/{{PathEscapeSegments $subJumpablePathName}}" title="{{$subJumpablePathName}}">
  33. {{$subJumpablePathFields := StringUtils.Split $subJumpablePathName "/"}}
  34. {{$subJumpablePathFieldLast := (Eval (len $subJumpablePathFields) "-" 1)}}
  35. {{if eq $subJumpablePathFieldLast 0}}
  36. {{$subJumpablePathName}}
  37. {{else}}
  38. {{$subJumpablePathPrefixes := slice $subJumpablePathFields 0 $subJumpablePathFieldLast}}
  39. <span class="text light-2">{{StringUtils.Join $subJumpablePathPrefixes "/"}}</span>/{{index $subJumpablePathFields $subJumpablePathFieldLast}}
  40. {{end}}
  41. </a>
  42. {{else}}
  43. <a class="entry-name" href="{{$.TreeLink}}/{{PathEscapeSegments $entry.Name}}" title="{{$entry.Name}}">{{$entry.Name}}</a>
  44. {{if $entry.IsLink}}
  45. <a class="entry-symbol-link flex-text-inline" data-tooltip-content title="{{ctx.Locale.Tr "repo.find_file.follow_symlink"}}" href="{{$.TreeLink}}/{{PathEscapeSegments $entry.Name}}?follow_symlink=1">{{svg "octicon-link" 12}}</a>
  46. {{end}}
  47. {{end}}
  48. {{end}}
  49. </div>
  50. <div class="repo-file-cell message loading-icon-2px">
  51. {{if $commit}}
  52. {{$commitLink := printf "%s/commit/%s" $.RepoLink (PathEscape $commit.ID.String)}}
  53. {{ctx.RenderUtils.RenderCommitMessageLinkSubject $commit.Message $commitLink $.Repository}}
  54. {{else}}
  55. … {{/* will be loaded again by LastCommitLoaderURL */}}
  56. {{end}}
  57. </div>
  58. <div class="repo-file-cell age">{{if $commit}}{{DateUtils.TimeSince $commit.Committer.When}}{{end}}</div>
  59. </div>
  60. {{end}}
  61. </div>