mirror of
https://github.com/go-gitea/gitea
synced 2025-07-22 18:28:37 +00:00
Refactor branch/tag selector dropdown (first step) (#23394)
Follow: * #23345 The branch/tag selector dropdown mixes jQuery/Fomantic UI/Vue together, it's very diffcult to maintain and causes unfixable a11y problems. It also causes problems like #19851 #21314 #21952 This PR is the first step for the refactoring, move `data-` attributes to JS object and use Vue data as much as possible. The old selector `'.choose.reference .dropdown'` was also wrong, it hits `<div class="choose reference"><svg class="dropdown icon">` and would cause undefined behaviors. I have done some quick tests and it works. After this PR gets merged, I will move the code into a Vue SFC in next PR.   --------- Co-authored-by: techknowlogick <techknowlogick@gitea.io>
This commit is contained in:
@@ -52,13 +52,13 @@
|
||||
data-modal-cherry-pick-type="revert"
|
||||
data-modal-cherry-pick-header="{{$.locale.Tr "repo.commit.revert-header" (ShortSha .CommitID)}}"
|
||||
data-modal-cherry-pick-content="{{$.locale.Tr "repo.commit.revert-content"}}"
|
||||
data-modal-cherry-pick-submit="{{.locale.Tr "repo.commit.revert"}}">{{.locale.Tr "repo.commit.revert"}}</a></div>
|
||||
data-modal-cherry-pick-submit="{{.locale.Tr "repo.commit.revert"}}">{{.locale.Tr "repo.commit.revert"}}</div>
|
||||
<div class="item cherry-pick-button show-modal"
|
||||
data-modal="#cherry-pick-modal"
|
||||
data-modal-cherry-pick-type="cherry-pick"
|
||||
data-modal-cherry-pick-header="{{$.locale.Tr "repo.commit.cherry-pick-header" (ShortSha .CommitID)}}"
|
||||
data-modal-cherry-pick-content="{{$.locale.Tr "repo.commit.cherry-pick-content"}}"
|
||||
data-modal-cherry-pick-submit="{{.locale.Tr "repo.commit.cherry-pick"}}">{{.locale.Tr "repo.commit.cherry-pick"}}</a></div>
|
||||
data-modal-cherry-pick-submit="{{.locale.Tr "repo.commit.cherry-pick"}}">{{.locale.Tr "repo.commit.cherry-pick"}}</div>
|
||||
<div class="ui basic modal" id="cherry-pick-modal">
|
||||
<div class="ui icon header">
|
||||
<span id="cherry-pick-header"></span>
|
||||
@@ -66,10 +66,10 @@
|
||||
<div class="content center">
|
||||
<p id="cherry-pick-content" class="branch-dropdown"></p>
|
||||
{{template "repo/branch_dropdown" dict "root" .
|
||||
"noTag" "true" "canCreateBranch" "false"
|
||||
"noTag" true "disableCreateBranch" true
|
||||
"branchForm" "branch-dropdown-form"
|
||||
"branchURLPrefix" (printf "%s/_cherrypick/%s/" $.RepoLink .CommitID) "branchURLSuffix" ""
|
||||
"setAction" "true" "submitForm" "true"}}
|
||||
"setAction" true "submitForm" true}}
|
||||
<form method="GET" action="{{$.RepoLink}}/_cherrypick/{{.CommitID}}/{{if $.BranchName}}{{PathEscapeSegments $.BranchName}}{{else}}{{PathEscapeSegments $.Repository.DefaultBranch}}{{end}}" id="branch-dropdown-form">
|
||||
<input type="hidden" name="ref" value="{{if $.BranchName}}{{$.BranchName}}{{else}}{{$.Repository.DefaultBranch}}{{end}}">
|
||||
<input type="hidden" name="refType" value="branch">
|
||||
|
Reference in New Issue
Block a user