|
2 | 2 | <input type="hidden" name="form-type" value="{{.IssueFormTemplate.FileName}}">
|
3 | 3 | {{range $field_idx, $field := .IssueFormTemplate.Fields}}
|
4 | 4 | {{- if $field.Attributes.label}}<h3 id="form-label-{{$field_idx}}">{{$field.Attributes.label}}</h3>{{end}}
|
5 |
| - {{- if $field.Attributes.description}}<div>{{RenderMarkdownToHtml $field.Attributes.description}}</div>{{end}} |
| 5 | + {{- if $field.Attributes.description}}<div>{{RenderMarkdownToHtml $field.Attributes.description}}</div>{{end}} |
6 | 6 |
|
7 |
| - {{- if eq .Type "markdown"}} |
| 7 | + {{- if eq .Type "markdown"}} |
8 | 8 | <div>{{RenderMarkdownToHtml $field.Attributes.value}}</div>
|
9 | 9 | {{else if eq .Type "input"}}
|
10 | 10 | <input type="text"
|
11 |
| - aria-labelledby="form-label-{{$field_idx}}" |
12 |
| - name="form-field-{{$field.ID}}" |
13 |
| - id="form-field-{{$field.ID}}" |
14 |
| - placeholder="{{$field.Attributes.placeholder}}" |
15 |
| - value="{{$field.Attributes.value}}" |
16 |
| - {{- if .Validations.required}}required{{end}} /> |
| 11 | + aria-labelledby="form-label-{{$field_idx}}" |
| 12 | + name="form-field-{{$field.ID}}" |
| 13 | + id="form-field-{{$field.ID}}" |
| 14 | + placeholder="{{$field.Attributes.placeholder}}" |
| 15 | + value="{{$field.Attributes.value}}" |
| 16 | + {{- if .Validations.required}}required{{end}} /> |
17 | 17 | {{else if eq .Type "textarea"}}
|
18 | 18 | {{- if .Attributes.render}}
|
19 | 19 | <input type="hidden" name="attrs-form-field-{{$field.ID}}" value="{"render": "{{.Attributes.render}}"}">
|
20 | 20 | {{end}}
|
21 | 21 | <textarea aria-labelledby="form-label-{{$field_idx}}"
|
22 | 22 | name="form-field-{{$field.ID}}"
|
23 |
| - id="form-field-{{$field.ID}}" |
24 |
| - placeholder="{{$field.Attributes.placeholder}}" |
25 |
| - {{- if .Attributes.render}}class="no-easymde"{{end}} |
26 |
| - {{- if .Validations.required}}required{{end}}>{{$field.Attributes.value}}</textarea> |
| 23 | + id="form-field-{{$field.ID}}" |
| 24 | + placeholder="{{$field.Attributes.placeholder}}" |
| 25 | + {{- if .Attributes.render}}class="no-easymde"{{end}} |
| 26 | + {{- if .Validations.required}}required{{end}}>{{$field.Attributes.value}}</textarea> |
27 | 27 | {{else if eq .Type "dropdown"}}
|
28 | 28 | {{/* TODO: work with .Attribtes.multiple */}}
|
29 | 29 | <select aria-labelledby="form-label-{{$field_idx}}"
|
|
38 | 38 | {{range $chk_id, $chk := $field.Attributes.options}}
|
39 | 39 | <label>
|
40 | 40 | <input type="checkbox"
|
41 |
| - name="form-field-{{$field.ID}}-{{$chk_id}}" |
42 |
| - id="form-field-{{$field.ID}}-{{$chk_id}}" |
43 |
| - {{if .checked}}checked{{end}} |
44 |
| - {{if .required}}required{{end}} /> |
| 41 | + name="form-field-{{$field.ID}}-{{$chk_id}}" |
| 42 | + id="form-field-{{$field.ID}}-{{$chk_id}}" |
| 43 | + {{if .checked}}checked{{end}} |
| 44 | + {{if .required}}required{{end}} /> |
45 | 45 | {{.label}}{{if .required}} <span style="color: orangered;">*</span>{{end}}
|
46 | 46 | </label><br>
|
47 | 47 | {{end}}
|
|
0 commit comments