1
1
mirror of https://github.com/go-gitea/gitea synced 2025-07-27 12:48:37 +00:00

Refactor template ctx and render utils (#32422)

Clean up the templates
This commit is contained in:
wxiaoguang
2024-11-05 14:04:26 +08:00
committed by GitHub
parent b068dbd40e
commit 4a469c8e1b
53 changed files with 281 additions and 205 deletions

View File

@@ -18,15 +18,15 @@
<input type="hidden" name="template-file" value="{{.TemplateFile}}">
{{range .Fields}}
{{if eq .Type "input"}}
{{template "repo/issue/fields/input" dict "Context" $.Context "item" .}}
{{template "repo/issue/fields/input" "item" .}}
{{else if eq .Type "markdown"}}
{{template "repo/issue/fields/markdown" dict "Context" $.Context "item" .}}
{{template "repo/issue/fields/markdown" "item" .}}
{{else if eq .Type "textarea"}}
{{template "repo/issue/fields/textarea" dict "Context" $.Context "item" . "root" $}}
{{template "repo/issue/fields/textarea" "item" . "root" $}}
{{else if eq .Type "dropdown"}}
{{template "repo/issue/fields/dropdown" dict "Context" $.Context "item" .}}
{{template "repo/issue/fields/dropdown" "item" .}}
{{else if eq .Type "checkboxes"}}
{{template "repo/issue/fields/checkboxes" dict "Context" $.Context "item" .}}
{{template "repo/issue/fields/checkboxes" "item" .}}
{{end}}
{{end}}
{{else}}