aboutsummaryrefslogtreecommitdiffstats
path: root/templates/repo
diff options
context:
space:
mode:
authora1012112796 <1012112796@qq.com>2021-03-01 03:57:45 +0800
committerGitHub <noreply@github.com>2021-02-28 19:57:45 +0000
commit83cf1a894e5a3a60ea72fa6b92744cb0705dd145 (patch)
tree516863d9c6ead4020004d1730d6bb2d91afbf56b /templates/repo
parent3e652860bb66fafe162079553f8640553c18fe79 (diff)
downloadgitea-83cf1a894e5a3a60ea72fa6b92744cb0705dd145.tar.gz
gitea-83cf1a894e5a3a60ea72fa6b92744cb0705dd145.zip
Create tag on ui (#13467)
Support create single tag directly support create tag with message from create release ui Signed-off-by: a1012112796 <1012112796@qq.com> Co-authored-by: Lauris BH <lauris@nix.lv> Co-authored-by: 6543 <6543@obermui.de> Co-authored-by: zeripath <art27@cantab.net>
Diffstat (limited to 'templates/repo')
-rw-r--r--templates/repo/branch_dropdown.tmpl11
-rw-r--r--templates/repo/release/new.tmpl13
2 files changed, 21 insertions, 3 deletions
diff --git a/templates/repo/branch_dropdown.tmpl b/templates/repo/branch_dropdown.tmpl
index 5dd0553d48..ca805fa587 100644
--- a/templates/repo/branch_dropdown.tmpl
+++ b/templates/repo/branch_dropdown.tmpl
@@ -24,12 +24,12 @@
<div class="header branch-tag-choice">
<div class="ui grid">
<div class="two column row">
- <a class="reference column" href="#" @click="mode = 'branches'; focusSearchField()">
+ <a class="reference column" href="#" @click="createTag = false; mode = 'branches'; focusSearchField()">
<span class="text" :class="{black: mode == 'branches'}">
{{svg "octicon-git-branch" 16 "mr-2"}}{{.i18n.Tr "repo.branches"}}
</span>
</a>
- <a class="reference column" href="#" @click="mode = 'tags'; focusSearchField()">
+ <a class="reference column" href="#" @click="createTag = true; mode = 'tags'; focusSearchField()">
<span class="text" :class="{black: mode == 'tags'}">
{{svg "octicon-tag" 16 "mr-2"}}{{.i18n.Tr "repo.tags"}}
</span>
@@ -41,7 +41,11 @@
<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">${ item.name }</div>
<div class="item" v-if="showCreateNewBranch" :class="{active: active == filteredItems.length}" :ref="'listItem' + filteredItems.length">
<a href="#" @click="createNewBranch()">
- <div>
+ <div v-show="createTag">
+ <i class="reference tags icon"></i>
+ {{.i18n.Tr "repo.tag.create_tag" `${ searchTerm }` | Safe}}
+ </div>
+ <div v-show="!createTag">
{{svg "octicon-git-branch"}}
{{.i18n.Tr "repo.branch.create_branch" `${ searchTerm }` | Safe}}
</div>
@@ -56,6 +60,7 @@
<form ref="newBranchForm" action="{{.RepoLink}}/branches/_new/{{EscapePound .BranchNameSubURL}}" method="post">
{{.CsrfTokenHtml}}
<input type="hidden" name="new_branch_name" v-model="searchTerm">
+ <input type="hidden" name="create_tag" v-model="createTag">
</form>
</div>
</div>
diff --git a/templates/repo/release/new.tmpl b/templates/repo/release/new.tmpl
index 473257a210..ef9115d1e2 100644
--- a/templates/repo/release/new.tmpl
+++ b/templates/repo/release/new.tmpl
@@ -67,6 +67,16 @@
<div class="ui container">
<div class="ui divider"></div>
<div class="ui text right">
+ {{if not .PageIsEditRelease}}
+ <div class="tag-message field">
+ <div class="ui checkbox">
+ <input type="checkbox" name="add_tag_msg">
+ <label><strong>{{.i18n.Tr "repo.release.add_tag_msg"}}</strong></label>
+ </div>
+ </div>
+ {{else}}
+ <input type="hidden" name="add_tag_msg" value="false">
+ {{end}}
<div class="prerelease field">
<div class="ui checkbox">
<input type="checkbox" name="prerelease" {{if .prerelease}}checked{{end}}>
@@ -93,6 +103,9 @@
</button>
{{end}}
{{else}}
+ {{if not .tag_name}}
+ <input class="ui grey button" type="submit" name="tag_only" value="{{.i18n.Tr "repo.release.add_tag"}}"/>
+ {{end}}
<input class="ui button" type="submit" name="draft" value="{{.i18n.Tr "repo.release.save_draft"}}"/>
<button class="ui primary button">
{{.i18n.Tr "repo.release.publish"}}