mirror of
https://github.com/go-gitea/gitea
synced 2025-07-22 18:28:37 +00:00
support the open-icon of folder (#34168)
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
This commit is contained in:
@@ -165,19 +165,11 @@ func newTreeViewNodeFromEntry(ctx context.Context, renderedIconPool *fileicon.Re
|
||||
FullPath: path.Join(parentDir, entry.Name()),
|
||||
}
|
||||
|
||||
if entry.IsLink() {
|
||||
// TODO: symlink to a folder or a file, the icon differs
|
||||
target, err := entry.FollowLink()
|
||||
if err == nil {
|
||||
_ = target.IsDir()
|
||||
// if target.IsDir() { } else { }
|
||||
}
|
||||
}
|
||||
|
||||
if node.EntryIcon == "" {
|
||||
node.EntryIcon = fileicon.RenderEntryIcon(renderedIconPool, entry)
|
||||
// TODO: no open icon support yet
|
||||
// node.EntryIconOpen = fileicon.RenderEntryIconOpen(renderedIconPool, entry)
|
||||
entryInfo := fileicon.EntryInfoFromGitTreeEntry(entry)
|
||||
node.EntryIcon = fileicon.RenderEntryIconHTML(renderedIconPool, entryInfo)
|
||||
if entryInfo.EntryMode.IsDir() {
|
||||
entryInfo.IsOpen = true
|
||||
node.EntryIconOpen = fileicon.RenderEntryIconHTML(renderedIconPool, entryInfo)
|
||||
}
|
||||
|
||||
if node.EntryMode == "commit" {
|
||||
|
Reference in New Issue
Block a user