From c0e2fd2e7d8a926f6bc6d40cd53d73ff382eb4b2 Mon Sep 17 00:00:00 2001 From: Kerwin Bryant Date: Mon, 13 Jan 2025 05:41:46 +0000 Subject: [PATCH] fix --- templates/repo/home_content.tmpl | 17 ++++++----------- .../js/features/repo-view-file-tree-sidebar.ts | 2 +- 2 files changed, 7 insertions(+), 12 deletions(-) diff --git a/templates/repo/home_content.tmpl b/templates/repo/home_content.tmpl index 59ad313fd3..d8e1890d43 100644 --- a/templates/repo/home_content.tmpl +++ b/templates/repo/home_content.tmpl @@ -7,17 +7,12 @@ {{template "repo/sub_menu" .}}
- {{- template "repo/branch_dropdown" dict - "Repository" .Repository - "ShowTabBranches" true - "ShowTabTags" true - "CurrentRefType" .RefFullName.RefType - "CurrentRefShortName" .RefFullName.ShortName - "CurrentTreePath" .TreePath - "RefLinkTemplate" "{RepoLink}/src/{RefTypeNameSubURL}/{TreePath}" - "AllowCreateNewRef" .CanCreateBranch - "ShowViewAllRefsEntry" true - -}} + {{if $hasTreeSidebar}} + + {{end}} + {{template "repo/home_branch_dropdown" (dict "ctxData" .)}} {{if and .CanCompareOrPull .IsViewBranch (not .Repository.IsArchived)}} {{$cmpBranch := ""}} {{if ne .Repository.ID .BaseRepo.ID}} diff --git a/web_src/js/features/repo-view-file-tree-sidebar.ts b/web_src/js/features/repo-view-file-tree-sidebar.ts index 6f2bdde125..569a9abe68 100644 --- a/web_src/js/features/repo-view-file-tree-sidebar.ts +++ b/web_src/js/features/repo-view-file-tree-sidebar.ts @@ -32,7 +32,7 @@ async function loadChildren(item, recursive?: boolean) { const apiBaseUrl = fileTree.getAttribute('data-api-base-url'); const refType = fileTree.getAttribute('data-current-ref-type'); const refName = fileTree.getAttribute('data-current-ref-short-name'); - const response = await GET(`${apiBaseUrl}/tree/${item ? item.path : ''}?ref=${refType}/${refName}&recursive=${recursive ?? false}`); + const response = await GET(`${apiBaseUrl}/tree/${item ? item.path : ''}?ref_type=${refType}&ref_name=${refName}&recursive=${recursive ?? false}`); const json = await response.json(); if (json instanceof Array) { return json.map((i) => ({