Skip to content

Commit dec0d34

Browse files
committed
The new entry is only supported on the repository homepage
1 parent f584f23 commit dec0d34

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

templates/repo/branch_dropdown.tmpl

+1
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636

3737
'mode': '{{if or .root.IsViewTag .isTag}}tags{{else}}branches{{end}}',
3838
'showBranchesInDropdown': {{$showBranchesInDropdown}},
39+
'showAllBranchsTagsEntry': {{$.showAllBranchsTagsEntry}},
3940
'searchFieldPlaceholder': '{{if $.noTag}}{{ctx.Locale.Tr "repo.pulls.filter_branch"}}{{else if $showBranchesInDropdown}}{{ctx.Locale.Tr "repo.filter_branch_and_tag"}}{{else}}{{ctx.Locale.Tr "repo.find_tag"}}{{end}}...',
4041
'branchForm': {{$.branchForm}},
4142
'disableCreateBranch': {{if .disableCreateBranch}}{{.disableCreateBranch}}{{else}}{{not .root.CanCreateBranch}}{{end}},

templates/repo/home.tmpl

+1-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
{{$isHomepage := (eq $n 0)}}
4848
<div class="repo-button-row" data-is-homepage="{{$isHomepage}}">
4949
<div class="repo-button-row-left">
50-
{{template "repo/branch_dropdown" dict "root" .}}
50+
{{template "repo/branch_dropdown" dict "root" . "showAllBranchsTagsEntry" true}}
5151
{{if and .CanCompareOrPull .IsViewBranch (not .Repository.IsArchived)}}
5252
{{$cmpBranch := ""}}
5353
{{if ne .Repository.ID .BaseRepo.ID}}

web_src/js/components/RepoBranchTagSelector.vue

+3-3
Original file line numberDiff line numberDiff line change
@@ -312,9 +312,9 @@ export default sfc; // activate IDE's Vue plugin
312312
<div class="message" v-if="showNoResults && !isLoading">
313313
{{ noResults }}
314314
</div>
315-
<div class="branch-tag-divider"/>
316-
<a v-if="mode === 'branches'" class="item" :href="repoLink + '/branches'">{{ textAllBranches }}</a>
317-
<a v-if="mode === 'tags'" class="item" :href="repoLink + '/tags'">{{ textAllTags }}</a>
315+
<div v-if="showAllBranchsTagsEntry" class="branch-tag-divider"/>
316+
<a v-if="showAllBranchsTagsEntry && mode === 'branches'" class="item" :href="repoLink + '/branches'">{{ textAllBranches }}</a>
317+
<a v-if="showAllBranchsTagsEntry && mode === 'tags'" class="item" :href="repoLink + '/tags'">{{ textAllTags }}</a>
318318
</div>
319319
</div>
320320
</template>

0 commit comments

Comments
 (0)