소스 검색

Repo create: Index in template

No need to set an extra value in the template data.
Achilleas Koutsou 5 년 전
부모
커밋
3ac9134b6b
2개의 변경된 파일1개의 추가작업 그리고 2개의 파일을 삭제
  1. 0 1
      internal/route/repo/repo.go
  2. 1 1
      templates/repo/create.tmpl

+ 0 - 1
internal/route/repo/repo.go

@@ -72,7 +72,6 @@ func Create(c *context.Context) {
 	// Give default value for template to render.
 	c.Data["Gitignores"] = db.Gitignores
 	c.Data["Licenses"] = db.Licenses
-	c.Data["license"] = db.Licenses[0]
 	c.Data["Readmes"] = db.Readmes
 	c.Data["readme"] = "Default"
 	c.Data["private"] = c.User.LastRepoVisibility

+ 1 - 1
templates/repo/create.tmpl

@@ -81,7 +81,7 @@
 							 href="/G-Node/Info/wiki/Licensing"><span
 							class="octicon octicon-question"></span></a>
 						<div class="ui search selection dropdown">
-							<input type="hidden" name="license" value="{{.license}}">
+							<input type="hidden" name="license" value="{{index .Licenses 0}}">
 							<div class="default text">{{.i18n.Tr "repo.license_helper"}}</div>
 							<div class="menu">
 								{{range .Licenses}}