mirror of
https://github.com/go-gitea/gitea.git
synced 2024-12-27 02:36:22 +01:00
c9e582c6b6
Refactor markdown editor to clarify its "preview" behavior and remove jQuery code. Close #15045 --------- Co-authored-by: silverwind <me@silverwind.io>
23 lines
702 B
Handlebars
23 lines
702 B
Handlebars
{{$textareaContent := .BodyQuery}}
|
|
{{if not $textareaContent}}{{$textareaContent = .IssueTemplate}}{{end}}
|
|
{{if not $textareaContent}}{{$textareaContent = .PullRequestTemplate}}{{end}}
|
|
{{if not $textareaContent}}{{$textareaContent = .content}}{{end}}
|
|
|
|
<div class="field">
|
|
{{template "shared/combomarkdowneditor" (dict
|
|
"CustomInit" true
|
|
"MarkdownPreviewInRepo" $.Repository
|
|
"MarkdownPreviewMode" "comment"
|
|
"TextareaName" "content"
|
|
"TextareaContent" $textareaContent
|
|
"TextareaPlaceholder" (ctx.Locale.Tr "repo.diff.comment.placeholder")
|
|
"DropzoneParentContainer" "form, .ui.form"
|
|
)}}
|
|
</div>
|
|
|
|
{{if .IsAttachmentEnabled}}
|
|
<div class="field">
|
|
{{template "repo/upload" .}}
|
|
</div>
|
|
{{end}}
|