Skip to content

Commit 7b69535

Browse files
committed
create tag only don't need title
1 parent d93f322 commit 7b69535

File tree

4 files changed

+9
-2
lines changed

4 files changed

+9
-2
lines changed

options/locale/locale_en-US.ini

+1
Original file line numberDiff line numberDiff line change
@@ -2307,6 +2307,7 @@ release.tag_helper = Choose an existing tag or create a new tag.
23072307
release.tag_helper_new = New tag. This tag will be created from the target.
23082308
release.tag_helper_existing = Existing tag.
23092309
release.title = Title
2310+
release.title_empty = Title cannot be empty.
23102311
release.content = Content
23112312
release.prerelease_desc = Mark as Pre-Release
23122313
release.prerelease_helper = Mark this release unsuitable for production use.

routers/web/repo/release.go

+6
Original file line numberDiff line numberDiff line change
@@ -408,6 +408,12 @@ func NewReleasePost(ctx *context.Context) {
408408
return
409409
}
410410

411+
// Title of release cannot be empty
412+
if len(form.Title) == 0 {
413+
ctx.RenderWithErr(ctx.Tr("repo.release.title_empty"), tplReleaseNew, &form)
414+
return
415+
}
416+
411417
rel = &repo_model.Release{
412418
RepoID: ctx.Repo.Repository.ID,
413419
Repo: ctx.Repo.Repository,

services/forms/repo_form.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -693,7 +693,7 @@ type UpdateAllowEditsForm struct {
693693
type NewReleaseForm struct {
694694
TagName string `binding:"Required;GitRefName;MaxSize(255)"`
695695
Target string `form:"tag_target" binding:"Required;MaxSize(255)"`
696-
Title string `binding:"Required;MaxSize(255)"`
696+
Title string `binding:"MaxSize(255)"`
697697
Content string
698698
Draft string
699699
TagOnly string

templates/repo/release/new.tmpl

+1-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
<div class="eleven wide column">
4848
<div class="field {{if .Err_Title}}error{{end}}">
4949
<label>{{.locale.Tr "repo.release.title"}}</label>
50-
<input name="title" placeholder="{{.locale.Tr "repo.release.title"}}" value="{{.title}}" autofocus required maxlength="255">
50+
<input name="title" placeholder="{{.locale.Tr "repo.release.title"}}" value="{{.title}}" autofocus maxlength="255">
5151
</div>
5252
<div class="field">
5353
<label>{{.locale.Tr "repo.release.content"}}</label>

0 commit comments

Comments
 (0)