-
-
Notifications
You must be signed in to change notification settings - Fork 5.8k
Filter for default-branch selection #29388
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 9 commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
c890e82
feature: filter branch in select default-branch view
zokkis 94663f7
Merge branch 'main' into feature/filter-branches
zokkis 5fe3a3f
use tailwind
zokkis 941a921
Merge branch 'main' into feature/filter-branches
silverwind 44a9d72
Don't use old helpers
zokkis 4b907da
style dropdown
zokkis 76c3d51
Merge branch 'main' into feature/filter-branches
zokkis a6df81f
feature: use search
zokkis c5f57a3
Update templates/repo/settings/branches.tmpl
silverwind b8f7a6e
Update web_src/js/components/RepoBranchTagSelector.vue
silverwind 2f24ac1
Update web_src/css/repo.css
silverwind ca230a9
reset templates/repo/branch_dropdown.tmpl
zokkis bc49c6a
Merge branch 'main' into feature/filter-branches
GiteaBot a6a611f
Merge branch 'main' into feature/filter-branches
GiteaBot c32722e
Merge branch 'main' into feature/filter-branches
GiteaBot 64181ca
Merge branch 'main' into feature/filter-branches
GiteaBot File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,89 +1,89 @@ | ||
{{/* Attributes: | ||
* root | ||
* ContainerClasses | ||
* (TODO: search "branch_dropdown" in the template directory) | ||
*/}} | ||
{{$defaultSelectedRefName := $.root.BranchName}} | ||
{{if and .root.IsViewTag (not .noTag)}} | ||
{{$defaultSelectedRefName = .root.TagName}} | ||
{{end}} | ||
{{if eq $defaultSelectedRefName ""}} | ||
{{$defaultSelectedRefName = $.root.Repository.DefaultBranch}} | ||
{{end}} | ||
|
||
{{$type := ""}} | ||
{{if and .root.IsViewTag (not .noTag)}} | ||
{{$type = "tag"}} | ||
{{else if .root.IsViewBranch}} | ||
{{$type = "branch"}} | ||
{{else}} | ||
{{$type = "tree"}} | ||
{{end}} | ||
|
||
{{$showBranchesInDropdown := not .root.HideBranchesInDropdown}} | ||
|
||
<script type="module"> | ||
const data = { | ||
'textReleaseCompare': {{ctx.Locale.Tr "repo.release.compare"}}, | ||
'textCreateTag': {{ctx.Locale.Tr "repo.tag.create_tag"}}, | ||
'textCreateBranch': {{ctx.Locale.Tr "repo.branch.create_branch"}}, | ||
'textCreateBranchFrom': {{ctx.Locale.Tr "repo.branch.create_from"}}, | ||
'textBranches': {{ctx.Locale.Tr "repo.branches"}}, | ||
'textTags': {{ctx.Locale.Tr "repo.tags"}}, | ||
'textDefaultBranchLabel': {{ctx.Locale.Tr "repo.default_branch_label"}}, | ||
|
||
'mode': '{{if or .root.IsViewTag .isTag}}tags{{else}}branches{{end}}', | ||
'showBranchesInDropdown': {{$showBranchesInDropdown}}, | ||
'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}}...', | ||
'branchForm': {{$.branchForm}}, | ||
'disableCreateBranch': {{if .disableCreateBranch}}{{.disableCreateBranch}}{{else}}{{not .root.CanCreateBranch}}{{end}}, | ||
'setAction': {{.setAction}}, | ||
'submitForm': {{.submitForm}}, | ||
'viewType': {{$type}}, | ||
'refName': {{if and .root.IsViewTag (not .noTag)}}{{.root.TagName}}{{else if .root.IsViewBranch}}{{.root.BranchName}}{{else}}{{ShortSha .root.CommitID}}{{end}}, | ||
'commitIdShort': {{ShortSha .root.CommitID}}, | ||
'tagName': {{.root.TagName}}, | ||
'branchName': {{.root.BranchName}}, | ||
'noTag': {{.noTag}}, | ||
'defaultSelectedRefName': {{$defaultSelectedRefName}}, | ||
'repoDefaultBranch': {{.root.Repository.DefaultBranch}}, | ||
'enableFeed': {{.root.EnableFeed}}, | ||
'rssURLPrefix': '{{$.root.RepoLink}}/rss/branch/', | ||
'branchURLPrefix': '{{if .branchURLPrefix}}{{.branchURLPrefix}}{{else}}{{$.root.RepoLink}}/{{if $.root.PageIsCommits}}commits{{else}}src{{end}}/branch/{{end}}', | ||
'branchURLSuffix': '{{if .branchURLSuffix}}{{.branchURLSuffix}}{{else}}{{if $.root.TreePath}}/{{PathEscapeSegments $.root.TreePath}}{{end}}{{end}}', | ||
'tagURLPrefix': '{{if .tagURLPrefix}}{{.tagURLPrefix}}{{else if .release}}{{$.root.RepoLink}}/compare/{{else}}{{$.root.RepoLink}}/{{if $.root.PageIsCommits}}commits{{else}}src{{end}}/tag/{{end}}', | ||
'tagURLSuffix': '{{if .tagURLSuffix}}{{.tagURLSuffix}}{{else if .release}}...{{if .release.IsDraft}}{{PathEscapeSegments .release.Target}}{{else}}{{if .release.TagName}}{{PathEscapeSegments .release.TagName}}{{else}}{{PathEscapeSegments .release.Sha1}}{{end}}{{end}}{{else}}{{if $.root.TreePath}}/{{PathEscapeSegments $.root.TreePath}}{{end}}{{end}}', | ||
'repoLink': {{.root.RepoLink}}, | ||
'treePath': {{.root.TreePath}}, | ||
'branchNameSubURL': {{.root.BranchNameSubURL}}, | ||
'noResults': {{ctx.Locale.Tr "repo.pulls.no_results"}}, | ||
}; | ||
{{if .release}} | ||
data.release = { | ||
'tagName': {{.release.TagName}}, | ||
}; | ||
* root | ||
* ContainerClasses | ||
* (TODO: search "branch_dropdown" in the template directory) | ||
*/}} | ||
{{$defaultSelectedRefName := $.root.BranchName}} | ||
{{if and .root.IsViewTag (not .noTag)}} | ||
{{$defaultSelectedRefName = .root.TagName}} | ||
{{end}} | ||
window.config.pageData.branchDropdownDataList = window.config.pageData.branchDropdownDataList || []; | ||
window.config.pageData.branchDropdownDataList.push(data); | ||
</script> | ||
|
||
<div class="js-branch-tag-selector {{if .ContainerClasses}}{{.ContainerClasses}}{{end}}"> | ||
{{/* show dummy elements before Vue componment is mounted, this code must match the code in BranchTagSelector.vue */}} | ||
<div class="ui dropdown custom"> | ||
<button class="branch-dropdown-button gt-ellipsis ui basic small compact button gt-df gt-m-0"> | ||
<span class="text gt-df gt-ac gt-mr-2"> | ||
{{if .release}} | ||
{{ctx.Locale.Tr "repo.release.compare"}} | ||
{{else}} | ||
{{if eq $type "tag"}} | ||
{{svg "octicon-tag"}} | ||
{{if eq $defaultSelectedRefName ""}} | ||
{{$defaultSelectedRefName = $.root.Repository.DefaultBranch}} | ||
{{end}} | ||
|
||
{{$type := ""}} | ||
{{if and .root.IsViewTag (not .noTag)}} | ||
{{$type = "tag"}} | ||
{{else if .root.IsViewBranch}} | ||
{{$type = "branch"}} | ||
{{else}} | ||
{{$type = "tree"}} | ||
{{end}} | ||
|
||
{{$showBranchesInDropdown := not .root.HideBranchesInDropdown}} | ||
|
||
<script type="module"> | ||
const data = { | ||
'textReleaseCompare': {{ctx.Locale.Tr "repo.release.compare"}}, | ||
'textCreateTag': {{ctx.Locale.Tr "repo.tag.create_tag"}}, | ||
'textCreateBranch': {{ctx.Locale.Tr "repo.branch.create_branch"}}, | ||
'textCreateBranchFrom': {{ctx.Locale.Tr "repo.branch.create_from"}}, | ||
'textBranches': {{ctx.Locale.Tr "repo.branches"}}, | ||
'textTags': {{ctx.Locale.Tr "repo.tags"}}, | ||
'textDefaultBranchLabel': {{ctx.Locale.Tr "repo.default_branch_label"}}, | ||
|
||
'mode': '{{if or .root.IsViewTag .isTag}}tags{{else}}branches{{end}}', | ||
'showBranchesInDropdown': {{$showBranchesInDropdown}}, | ||
'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}}...', | ||
'branchForm': {{$.branchForm}}, | ||
'disableCreateBranch': {{if .disableCreateBranch}}{{.disableCreateBranch}}{{else}}{{not .root.CanCreateBranch}}{{end}}, | ||
'setAction': {{.setAction}}, | ||
'submitForm': {{.submitForm}}, | ||
'viewType': {{$type}}, | ||
'refName': {{if and .root.IsViewTag (not .noTag)}}{{.root.TagName}}{{else if .root.IsViewBranch}}{{.root.BranchName}}{{else}}{{ShortSha .root.CommitID}}{{end}}, | ||
'commitIdShort': {{ShortSha .root.CommitID}}, | ||
'tagName': {{.root.TagName}}, | ||
'branchName': {{.root.BranchName}}, | ||
'noTag': {{.noTag}}, | ||
'defaultSelectedRefName': {{$defaultSelectedRefName}}, | ||
'repoDefaultBranch': {{.root.Repository.DefaultBranch}}, | ||
'enableFeed': {{.root.EnableFeed}}, | ||
'rssURLPrefix': '{{$.root.RepoLink}}/rss/branch/', | ||
'branchURLPrefix': '{{if .branchURLPrefix}}{{.branchURLPrefix}}{{else}}{{$.root.RepoLink}}/{{if $.root.PageIsCommits}}commits{{else}}src{{end}}/branch/{{end}}', | ||
'branchURLSuffix': '{{if .branchURLSuffix}}{{.branchURLSuffix}}{{else}}{{if $.root.TreePath}}/{{PathEscapeSegments $.root.TreePath}}{{end}}{{end}}', | ||
'tagURLPrefix': '{{if .tagURLPrefix}}{{.tagURLPrefix}}{{else if .release}}{{$.root.RepoLink}}/compare/{{else}}{{$.root.RepoLink}}/{{if $.root.PageIsCommits}}commits{{else}}src{{end}}/tag/{{end}}', | ||
'tagURLSuffix': '{{if .tagURLSuffix}}{{.tagURLSuffix}}{{else if .release}}...{{if .release.IsDraft}}{{PathEscapeSegments .release.Target}}{{else}}{{if .release.TagName}}{{PathEscapeSegments .release.TagName}}{{else}}{{PathEscapeSegments .release.Sha1}}{{end}}{{end}}{{else}}{{if $.root.TreePath}}/{{PathEscapeSegments $.root.TreePath}}{{end}}{{end}}', | ||
'repoLink': {{.root.RepoLink}}, | ||
'treePath': {{.root.TreePath}}, | ||
'branchNameSubURL': {{.root.BranchNameSubURL}}, | ||
'noResults': {{ctx.Locale.Tr "repo.pulls.no_results"}}, | ||
}; | ||
{{if .release}} | ||
data.release = { | ||
'tagName': {{.release.TagName}}, | ||
}; | ||
{{end}} | ||
window.config.pageData.branchDropdownDataList = window.config.pageData.branchDropdownDataList || []; | ||
window.config.pageData.branchDropdownDataList.push(data); | ||
</script> | ||
|
||
<div class="js-branch-tag-selector {{if .ContainerClasses}}{{.ContainerClasses}}{{end}}"> | ||
{{/* show dummy elements before Vue componment is mounted, this code must match the code in BranchTagSelector.vue */}} | ||
<div class="ui dropdown custom"> | ||
<button class="branch-dropdown-button gt-ellipsis ui basic small compact button gt-df gt-m-0"> | ||
<span class="text gt-df gt-ac gt-mr-2"> | ||
{{if .release}} | ||
{{ctx.Locale.Tr "repo.release.compare"}} | ||
{{else}} | ||
{{svg "octicon-git-branch"}} | ||
{{if eq $type "tag"}} | ||
{{svg "octicon-tag"}} | ||
{{else}} | ||
{{svg "octicon-git-branch"}} | ||
{{end}} | ||
<strong ref="dropdownRefName" class="gt-ml-3">{{if and .root.IsViewTag (not .noTag)}}{{.root.TagName}}{{else if .root.IsViewBranch}}{{.root.BranchName}}{{else}}{{ShortSha .root.CommitID}}{{end}}</strong> | ||
{{end}} | ||
<strong ref="dropdownRefName" class="gt-ml-3">{{if and .root.IsViewTag (not .noTag)}}{{.root.TagName}}{{else if .root.IsViewBranch}}{{.root.BranchName}}{{else}}{{ShortSha .root.CommitID}}{{end}}</strong> | ||
{{end}} | ||
</span> | ||
{{svg "octicon-triangle-down" 14 "dropdown icon"}} | ||
</button> | ||
</div> | ||
</div> | ||
</span> | ||
{{svg "octicon-triangle-down" 14 "dropdown icon"}} | ||
</button> | ||
</div> | ||
</div> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3006,4 +3006,4 @@ tbody.commit-list { | |
|
||
#cherry-pick-modal .scrolling.menu { | ||
max-height: 200px; | ||
} | ||
} | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.