Make issue template field template access correct template data (#26698) (#26709)

Backport #26698 by @wxiaoguang

Regression of #23092, the `{{$field := .}}` was missing during that
refactoring.

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
(cherry picked from commit 4af872178e)
This commit is contained in:
Giteabot 2023-08-24 19:40:55 +08:00 committed by Earl Warren
parent 4da20765e8
commit 560ff3ea36
No known key found for this signature in database
GPG key ID: 0579CB2928A78A00

View file

@ -1,10 +1,9 @@
<div class="field">
{{template "repo/issue/fields/header" .}}
{{$field := .}}
{{range $i, $opt := .item.Attributes.options}}
<div class="field">
<div class="ui checkbox">
<input type="checkbox" name="form-field-{{$field.ID}}-{{$i}}" {{if $opt.required}}readonly checked{{end}}>
<input type="checkbox" name="form-field-{{$.item.ID}}-{{$i}}" {{if $opt.required}}readonly checked{{end}}>
<label>{{$opt.label}}</label>
</div>
</div>