Skip to content

Commit fc9b390

Browse files
committed
fix
1 parent 8c323e1 commit fc9b390

File tree

4 files changed

+14
-7
lines changed

4 files changed

+14
-7
lines changed

templates/repo/branch_dropdown.tmpl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
* ShowTabBranches
1111
* ShowTabTagsTab
1212
* AllowCreateNewRef
13+
* ShowViewAllRefsEntry
1314

1415
Search "repo/branch_dropdown" in the template directory to find all occurrences.
1516
*/}}
@@ -24,6 +25,8 @@ Search "repo/branch_dropdown" in the template directory to find all occurrences.
2425
data-text-create-branch="{{ctx.Locale.Tr "repo.branch.create_branch"}}"
2526
data-text-create-ref-from="{{ctx.Locale.Tr "repo.branch.create_from"}}"
2627
data-text-no-results="{{ctx.Locale.Tr "no_results_found"}}"
28+
data-text-view-all-branches="{{ctx.Locale.Tr "repo.view_all_branches"}}"
29+
data-text-view-all-tags="{{ctx.Locale.Tr "repo.view_all_tags"}}"
2730

2831
data-current-repo-default-branch="{{.Repository.DefaultBranch}}"
2932
data-current-repo-link="{{.Repository.Link}}"
@@ -37,6 +40,7 @@ Search "repo/branch_dropdown" in the template directory to find all occurrences.
3740
data-show-tab-branches="{{.ShowTabBranches}}"
3841
data-show-tab-tags="{{.ShowTabTags}}"
3942
data-allow-create-new-ref="{{.AllowCreateNewRef}}"
43+
data-show-view-all-refs-entry="{{.ShowViewAllRefsEntry}}"
4044

4145
data-enable-feed="{{ctx.RootData.EnableFeed}}"
4246
>

templates/repo/home.tmpl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@
6262
"CurrentTreePath" .TreePath
6363
"RefLinkTemplate" "{RepoLink}/src/{RefType}/{RefShortName}/{TreePath}"
6464
"AllowCreateNewRef" .CanCreateBranch
65+
"ShowViewAllRefsEntry" true
6566
}}
6667
{{if and .CanCompareOrPull .IsViewBranch (not .Repository.IsArchived)}}
6768
{{$cmpBranch := ""}}

web_src/css/repo.css

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2851,11 +2851,8 @@ tbody.commit-list {
28512851
}
28522852

28532853
.branch-selector-dropdown .branch-tag-divider {
2854-
border-top: 1px solid var(--color-secondary);
2855-
}
2856-
2857-
.branch-selector-dropdown .branch-tag-tab + .branch-tag-divider {
28582854
margin-top: -1px !important;
2855+
border-top: 1px solid var(--color-secondary);
28592856
}
28602857

28612858
.branch-selector-dropdown .scrolling.menu {

web_src/js/components/RepoBranchTagSelector.vue

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,8 @@ const sfc = {
8686
textCreateBranch: elRoot.getAttribute('data-text-create-branch'),
8787
textCreateRefFrom: elRoot.getAttribute('data-text-create-ref-from'),
8888
textNoResults: elRoot.getAttribute('data-text-no-results'),
89+
textViewAllBranches: elRoot.getAttribute('data-text-view-all-branches'),
90+
textViewAllTags: elRoot.getAttribute('data-text-view-all-tags'),
8991
9092
currentRepoDefaultBranch: elRoot.getAttribute('data-current-repo-default-branch'),
9193
currentRepoLink: elRoot.getAttribute('data-current-repo-link'),
@@ -99,6 +101,7 @@ const sfc = {
99101
showTabBranches: shouldShowTabBranches,
100102
showTabTags: elRoot.getAttribute('data-show-tab-tags') === 'true',
101103
allowCreateNewRef: elRoot.getAttribute('data-allow-create-new-ref') === 'true',
104+
showViewAllRefsEntry: elRoot.getAttribute('data-show-view-all-refs-entry') === 'true',
102105
103106
enableFeed: elRoot.getAttribute('data-enable-feed') === 'true',
104107
};
@@ -281,9 +284,11 @@ export default sfc; // activate IDE's Vue plugin
281284
<div class="message" v-if="showNoResults">
282285
{{ textNoResults }}
283286
</div>
284-
<div v-if="showViewAllBranchsTagsEntry" class="branch-tag-divider"/>
285-
<a v-if="showViewAllBranchsTagsEntry && mode === 'branches'" class="item" :href="repoLink + '/branches'">{{ textViewAllBranches }}</a>
286-
<a v-if="showViewAllBranchsTagsEntry && mode === 'tags'" class="item" :href="repoLink + '/tags'">{{ textViewAllTags }}</a>
287+
<template v-if="showViewAllRefsEntry">
288+
<div class="divider tw-m-0"/>
289+
<a v-if="selectedTab === 'branches'" class="item" :href="currentRepoLink + '/branches'">{{ textViewAllBranches }}</a>
290+
<a v-if="selectedTab === 'tags'" class="item" :href="currentRepoLink + '/tags'">{{ textViewAllTags }}</a>
291+
</template>
287292
</div>
288293
</div>
289294
</template>

0 commit comments

Comments
 (0)