mirror of
				https://gitee.com/gitea/gitea
				synced 2025-11-04 08:30:25 +08:00 
			
		
		
		
	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`
This commit is contained in:
		@@ -1,19 +1,3 @@
 | 
			
		||||
{{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}}
 | 
			
		||||
{{else}}
 | 
			
		||||
	<div class="ui top tabular menu" data-write="write" data-preview="preview">
 | 
			
		||||
		<a class="active item" data-tab="write">{{.locale.Tr "write"}}</a>
 | 
			
		||||
		<a class="item" data-tab="preview" data-url="{{.Repository.Link}}/markdown" data-context="{{.RepoLink}}">{{.locale.Tr "preview"}}</a>
 | 
			
		||||
@@ -28,7 +12,6 @@
 | 
			
		||||
			{{.locale.Tr "loading"}}
 | 
			
		||||
		</div>
 | 
			
		||||
	</div>
 | 
			
		||||
{{end}}
 | 
			
		||||
{{if .IsAttachmentEnabled}}
 | 
			
		||||
	<div class="field">
 | 
			
		||||
		{{template "repo/upload" .}}
 | 
			
		||||
 
 | 
			
		||||
@@ -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>
 | 
			
		||||
					{{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}}
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user