Skip to content

Commit 008f5d8

Browse files
authored
Add default label in branch select list (#26697)
1 parent ad3cbbc commit 008f5d8

File tree

3 files changed

+5
-0
lines changed

3 files changed

+5
-0
lines changed

options/locale/locale_en-US.ini

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -970,6 +970,7 @@ trust_model_helper_collaborator_committer = Collaborator+Committer: Trust signat
970970
trust_model_helper_default = Default: Use the default trust model for this installation
971971
create_repo = Create Repository
972972
default_branch = Default Branch
973+
default_branch_label = default
973974
default_branch_helper = The default branch is the base branch for pull requests and code commits.
974975
mirror_prune = Prune
975976
mirror_prune_desc = Remove obsolete remote-tracking references

templates/repo/branch_dropdown.tmpl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
'textCreateBranchFrom': {{.root.locale.Tr "repo.branch.create_from"}},
3131
'textBranches': {{.root.locale.Tr "repo.branches"}},
3232
'textTags': {{.root.locale.Tr "repo.tags"}},
33+
'textDefaultBranchLabel': {{.root.locale.Tr "repo.default_branch_label"}},
3334

3435
'mode': '{{if or .root.IsViewTag .isTag}}tags{{else}}branches{{end}}',
3536
'showBranchesInDropdown': {{$showBranchesInDropdown}},

web_src/js/components/RepoBranchTagSelector.vue

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,9 @@
3030
<div class="loading-indicator is-loading" v-if="isLoading"/>
3131
<div v-for="(item, index) in filteredItems" :key="item.name" class="item" :class="{selected: item.selected, active: active === index}" @click="selectItem(item)" :ref="'listItem' + index">
3232
{{ item.name }}
33+
<div class="ui label" v-if="item.name===defaultBranch && mode === 'branches'">
34+
{{ textDefaultBranchLabel }}
35+
</div>
3336
<a v-show="enableFeed && mode === 'branches'" role="button" class="rss-icon ui compact right" :href="rssURLPrefix + item.url" target="_blank" @click.stop>
3437
<!-- creating a lot of Vue component is pretty slow, so we use a static SVG here -->
3538
<svg width="14" height="14" class="svg octicon-rss"><use href="#svg-symbol-octicon-rss"/></svg>

0 commit comments

Comments
 (0)