mirror of
https://github.com/go-gitea/gitea
synced 2025-07-22 18:28:37 +00:00
Refactor the "attachments" sub-template data key to RenderedContent (#29517)
The value passed into "attachments" sub-template is from "RedneredContent", so use the same name for consistent. And it makes readers easy to know its data type.
This commit is contained in:
@@ -8,7 +8,7 @@
|
||||
<div class="gt-f1 gt-p-3">
|
||||
<a target="_blank" rel="noopener noreferrer" href="{{.DownloadURL}}" title="{{ctx.Locale.Tr "repo.issues.attachment.open_tab" .Name}}">
|
||||
{{if FilenameIsImage .Name}}
|
||||
{{if not (StringUtils.Contains (StringUtils.ToString $.Content) .UUID)}}
|
||||
{{if not (StringUtils.Contains (StringUtils.ToString $.RenderedContent) .UUID)}}
|
||||
{{$hasThumbnails = true}}
|
||||
{{end}}
|
||||
{{svg "octicon-file"}}
|
||||
@@ -29,7 +29,7 @@
|
||||
<div class="ui small thumbnails">
|
||||
{{- range .Attachments -}}
|
||||
{{if FilenameIsImage .Name}}
|
||||
{{if not (StringUtils.Contains (StringUtils.ToString $.Content) .UUID)}}
|
||||
{{if not (StringUtils.Contains (StringUtils.ToString $.RenderedContent) .UUID)}}
|
||||
<a target="_blank" rel="noopener noreferrer" href="{{.DownloadURL}}">
|
||||
<img alt="{{.Name}}" src="{{.DownloadURL}}" title="{{ctx.Locale.Tr "repo.issues.attachment.open_tab" .Name}}">
|
||||
</a>
|
||||
|
@@ -69,7 +69,7 @@
|
||||
<div id="issuecomment-{{.ID}}-raw" class="raw-content gt-hidden">{{.Content}}</div>
|
||||
<div class="edit-content-zone gt-hidden" data-update-url="{{$.RepoLink}}/comments/{{.ID}}" data-context="{{$.RepoLink}}" data-attachment-url="{{$.RepoLink}}/comments/{{.ID}}/attachments"></div>
|
||||
{{if .Attachments}}
|
||||
{{template "repo/issue/view_content/attachments" dict "ctxData" $ "Attachments" .Attachments "Content" .RenderedContent}}
|
||||
{{template "repo/issue/view_content/attachments" dict "ctxData" $ "Attachments" .Attachments "RenderedContent" .RenderedContent}}
|
||||
{{end}}
|
||||
</div>
|
||||
{{$reactions := .Reactions.GroupByType}}
|
||||
@@ -440,7 +440,7 @@
|
||||
<div id="issuecomment-{{.ID}}-raw" class="raw-content gt-hidden">{{.Content}}</div>
|
||||
<div class="edit-content-zone gt-hidden" data-update-url="{{$.RepoLink}}/comments/{{.ID}}" data-context="{{$.RepoLink}}" data-attachment-url="{{$.RepoLink}}/comments/{{.ID}}/attachments"></div>
|
||||
{{if .Attachments}}
|
||||
{{template "repo/issue/view_content/attachments" dict "ctxData" $ "Attachments" .Attachments "Content" .RenderedContent}}
|
||||
{{template "repo/issue/view_content/attachments" dict "ctxData" $ "Attachments" .Attachments "RenderedContent" .RenderedContent}}
|
||||
{{end}}
|
||||
</div>
|
||||
{{$reactions := .Reactions.GroupByType}}
|
||||
|
@@ -95,7 +95,7 @@
|
||||
<div id="issuecomment-{{.ID}}-raw" class="raw-content gt-hidden">{{.Content}}</div>
|
||||
<div class="edit-content-zone gt-hidden" data-update-url="{{$.RepoLink}}/comments/{{.ID}}" data-context="{{$.RepoLink}}" data-attachment-url="{{$.RepoLink}}/comments/{{.ID}}/attachments"></div>
|
||||
{{if .Attachments}}
|
||||
{{template "repo/issue/view_content/attachments" dict "ctxData" $ "Attachments" .Attachments "Content" .RenderedContent}}
|
||||
{{template "repo/issue/view_content/attachments" dict "ctxData" $ "Attachments" .Attachments "RenderedContent" .RenderedContent}}
|
||||
{{end}}
|
||||
</div>
|
||||
{{$reactions := .Reactions.GroupByType}}
|
||||
|
Reference in New Issue
Block a user