Browse Source

Removed unused field in form (#3023)

Ethan Koenig 2 years ago
parent
commit
013db70fce
2 changed files with 4 additions and 6 deletions
  1. 3 4
      modules/auth/repo_form.go
  2. 1 2
      templates/repo/wiki/new.tmpl

+ 3 - 4
modules/auth/repo_form.go

@@ -362,10 +362,9 @@ func (f *EditReleaseForm) Validate(ctx *macaron.Context, errs binding.Errors) bi
362 362
 
363 363
 // NewWikiForm form for creating wiki
364 364
 type NewWikiForm struct {
365
-	OldTitle string
366
-	Title    string `binding:"Required"`
367
-	Content  string `binding:"Required"`
368
-	Message  string
365
+	Title   string `binding:"Required"`
366
+	Content string `binding:"Required"`
367
+	Message string
369 368
 }
370 369
 
371 370
 // Validate validates the fields

+ 1 - 2
templates/repo/wiki/new.tmpl

@@ -13,12 +13,11 @@
13 13
 		</div>
14 14
 		<form class="ui form" action="{{.Link}}" method="post">
15 15
 			{{.CsrfTokenHtml}}
16
-			<input type="hidden" name="old_title" value="{{.old_title}}">
17 16
 			<div class="field {{if .Err_Title}}error{{end}}">
18 17
 				<input name="title" value="{{.title}}" autofocus required>
19 18
 			</div>
20 19
 			<div class="field">
21
-				<textarea id="edit_area" name="content" data-id="wiki-{{.old_title}}" data-url="{{AppSubUrl}}/api/v1/markdown" data-context="{{.RepoLink}}/wiki">{{if .PageIsWikiEdit}}{{.content}}{{else}}{{.i18n.Tr "repo.wiki.welcome"}}{{end}}</textarea required>
20
+				<textarea id="edit_area" name="content" data-id="wiki-{{.title}}" data-url="{{AppSubUrl}}/api/v1/markdown" data-context="{{.RepoLink}}/wiki">{{if .PageIsWikiEdit}}{{.content}}{{else}}{{.i18n.Tr "repo.wiki.welcome"}}{{end}}</textarea required>
22 21
 			</div>
23 22
 			<div class="field">
24 23
 				<input name="message" placeholder="{{.i18n.Tr "repo.wiki.default_commit_message"}}">