Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
kerwin612 committed Jan 13, 2025
1 parent 67a749f commit c0e2fd2
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 12 deletions.
17 changes: 6 additions & 11 deletions templates/repo/home_content.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,12 @@
{{template "repo/sub_menu" .}}
<div class="repo-button-row">
<div class="repo-button-row-left">
{{- 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}}
<button class="show-tree-sidebar-button ui compact basic button icon not-mobile {{if $showTreeSidebar}}tw-hidden{{end}}" title="{{ctx.Locale.Tr "repo.diff.show_file_tree"}}">
{{svg "octicon-sidebar-collapse" 20 "icon"}}
</button>
{{end}}
{{template "repo/home_branch_dropdown" (dict "ctxData" .)}}
{{if and .CanCompareOrPull .IsViewBranch (not .Repository.IsArchived)}}
{{$cmpBranch := ""}}
{{if ne .Repository.ID .BaseRepo.ID}}
Expand Down
2 changes: 1 addition & 1 deletion web_src/js/features/repo-view-file-tree-sidebar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) => ({
Expand Down

0 comments on commit c0e2fd2

Please sign in to comment.