diff options
author | wxiaoguang <wxiaoguang@gmail.com> | 2023-03-22 05:04:17 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-03-21 17:04:17 -0400 |
commit | 76a1edf74f5f7fdf733b46fde12df644295e9fe8 (patch) | |
tree | 46e9ba89a2377aacbb475e16868ccc5b34eb44a4 /templates/repo/issue/new_form.tmpl | |
parent | 9b0190884d88ad15cf67e1288a302d22e88d37aa (diff) | |
download | gitea-76a1edf74f5f7fdf733b46fde12df644295e9fe8.tar.gz gitea-76a1edf74f5f7fdf733b46fde12df644295e9fe8.zip |
Decouple the issue-template code from comment_tab.tmpl (#23556)
It would help #23290
The issue-template code is only useful for "new issue" or "new PR", so
it could only be put in the `new_form.tmpl`
Diffstat (limited to 'templates/repo/issue/new_form.tmpl')
-rw-r--r-- | templates/repo/issue/new_form.tmpl | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/templates/repo/issue/new_form.tmpl b/templates/repo/issue/new_form.tmpl index 4945203ca5..f6ef8e6754 100644 --- a/templates/repo/issue/new_form.tmpl +++ b/templates/repo/issue/new_form.tmpl @@ -16,7 +16,29 @@ <div class="title_wip_desc" data-wip-prefixes="{{Json .PullRequestWorkInProgressPrefixes}}">{{.locale.Tr "repo.pulls.title_wip_desc" (index .PullRequestWorkInProgressPrefixes 0| Escape) | Safe}}</div> {{end}} </div> - {{template "repo/issue/comment_tab" .}} + {{if .Fields}} + <input type="hidden" name="template-file" value="{{.TemplateFile}}"> + {{range .Fields}} + {{if eq .Type "input"}} + {{template "repo/issue/fields/input" Dict "Context" $.Context "item" .}} + {{else if eq .Type "markdown"}} + {{template "repo/issue/fields/markdown" Dict "Context" $.Context "item" .}} + {{else if eq .Type "textarea"}} + {{template "repo/issue/fields/textarea" Dict "Context" $.Context "item" .}} + {{else if eq .Type "dropdown"}} + {{template "repo/issue/fields/dropdown" Dict "Context" $.Context "item" .}} + {{else if eq .Type "checkboxes"}} + {{template "repo/issue/fields/checkboxes" Dict "Context" $.Context "item" .}} + {{end}} + {{end}} + {{if .IsAttachmentEnabled}} + <div class="field"> + {{template "repo/upload" .}} + </div> + {{end}} + {{else}} + {{template "repo/issue/comment_tab" .}} + {{end}} <div class="text right"> <button class="ui green button loading-button" tabindex="6"> {{if .PageIsComparePull}} |