aboutsummaryrefslogtreecommitdiff
path: root/templates
diff options
context:
space:
mode:
authorZettat1232023-03-11 00:42:38 +0800
committerGitHub2023-03-10 10:42:38 -0600
commit3de9e63fd04d61e08fcbdec035c9f138347d9f37 (patch)
tree32bb66811664eedfb75392bb42a7ad4c907c7efb /templates
parent5155ec35c571de8df62318df78c78cebc20e1aa0 (diff)
Hide target selector if tag exists when creating new release (#23171)
Close #22649. |status|screenshot| |-|-| |empty tag name|<img src="https://user-images.githubusercontent.com/15528715/221490165-fd3abd2e-6dc5-4562-bece-d1d6a305479e.png" width="300px"/>| |new tag|<img src="https://user-images.githubusercontent.com/15528715/221490450-49b2a48e-b206-49f4-bd79-34b1ea64156f.png" width="300px"/>| |existing tag|<img src="https://user-images.githubusercontent.com/15528715/221490301-4d1879dd-4947-4abc-9b9a-e77be1806981.png" width="300px"/>|
Diffstat (limited to 'templates')
-rw-r--r--templates/repo/release/new.tmpl33
1 files changed, 19 insertions, 14 deletions
diff --git a/templates/repo/release/new.tmpl b/templates/repo/release/new.tmpl
index 37d7ca032..d7c580fed 100644
--- a/templates/repo/release/new.tmpl
+++ b/templates/repo/release/new.tmpl
@@ -20,22 +20,27 @@
<b>{{.tag_name}}</b><span class="at">@</span><strong>{{.tag_target}}</strong>
{{else}}
<input id="tag-name" name="tag_name" value="{{.tag_name}}" placeholder="{{.locale.Tr "repo.release.tag_name"}}" autofocus required maxlength="255">
- <span class="at">@</span>
- <div class="ui selection dropdown">
- <input type="hidden" name="tag_target" value="{{.tag_target}}"/>
- {{svg "octicon-git-branch"}}
- <div class="text">
- {{.locale.Tr "repo.release.target"}} :
- <strong id="repo-branch-current">{{.Repository.DefaultBranch}}</strong>
- </div>
- {{svg "octicon-triangle-down" 14 "dropdown icon"}}
- <div class="menu">
- {{range .Branches}}
- <div class="item" data-value="{{.}}">{{.}}</div>
- {{end}}
+ <input id="tag-name-editor" type="hidden" data-existing-tags={{Json .Tags}} data-tag-helper={{.locale.Tr "repo.release.tag_helper"}} data-tag-helper-new={{.locale.Tr "repo.release.tag_helper_new"}} data-tag-helper-existing={{.locale.Tr "repo.release.tag_helper_existing"}} />
+ <div id="tag-target-selector" class="gt-dib">
+ <span class="at">@</span>
+ <div class="ui selection dropdown">
+ <input type="hidden" name="tag_target" value="{{.tag_target}}"/>
+ {{svg "octicon-git-branch"}}
+ <div class="text">
+ {{.locale.Tr "repo.release.target"}} :
+ <strong id="repo-branch-current">{{.Repository.DefaultBranch}}</strong>
+ </div>
+ {{svg "octicon-triangle-down" 14 "dropdown icon"}}
+ <div class="menu">
+ {{range .Branches}}
+ <div class="item" data-value="{{.}}">{{.}}</div>
+ {{end}}
+ </div>
</div>
</div>
- <span class="help">{{.locale.Tr "repo.release.tag_helper"}}</span>
+ <div>
+ <span id="tag-helper" class="help gt-mt-2">{{.locale.Tr "repo.release.tag_helper"}}</span>
+ </div>
{{end}}
</div>
</div>