2022-03-22 09:21:55 +01:00
|
|
|
{{ define "form_input_array" }}
|
|
|
|
{{ $root := . }}
|
|
|
|
{{ $fullProperty := getFullProperty .Parent .Property }}
|
|
|
|
{{ $values := getValue .Defaults .Values $fullProperty }}
|
|
|
|
<table width="100%">
|
|
|
|
<tbody>
|
|
|
|
{{ range $index, $value := $values }}
|
|
|
|
{{ $itemFullProperty := printf "%s/%d" $fullProperty $index }}
|
|
|
|
{{ $itemProperty := printf "%d" $index }}
|
|
|
|
{{ $itemSchema := getItemSchema $root.Schema }}
|
|
|
|
{{ $formItemData := formItemData $root $itemProperty $itemSchema }}
|
|
|
|
<tr>
|
|
|
|
{{ template "form_row" $formItemData }}
|
|
|
|
</tr>
|
|
|
|
<tr>
|
2022-05-04 12:23:53 +02:00
|
|
|
<td></td>
|
|
|
|
<td colspan="2">
|
|
|
|
<input type="submit"
|
|
|
|
class="bg-red-600 text-white mb-2 px-3 py-1 rounded-md text-sm font-medium hover:bg-red-700 transition duration-300"
|
|
|
|
name="del:{{ $fullProperty }}/{{$index}}"
|
2022-05-09 14:23:23 +02:00
|
|
|
value="Remove" />
|
2022-03-22 09:21:55 +01:00
|
|
|
<hr />
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
{{end}}
|
|
|
|
<tr>
|
|
|
|
<td colspan="2"></td>
|
|
|
|
<td align="right">
|
2022-05-04 12:23:53 +02:00
|
|
|
<input
|
|
|
|
class="bg-blue-500 text-white mb-2 mt-2 px-3 py-1 rounded-md text-sm font-medium hover:bg-blue-700 transition duration-300"
|
|
|
|
type="submit"
|
|
|
|
name="add:{{ $fullProperty }}/-"
|
2022-05-09 14:23:23 +02:00
|
|
|
value="Add" />
|
2022-03-22 09:21:55 +01:00
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
{{ end }}
|