1
1
mirror of https://github.com/go-gitea/gitea synced 2025-07-28 13:18:37 +00:00

Enable Uploading/Removing Attachments When Editing an Issue/Comment (#8426)

This commit is contained in:
blueworrybear
2019-10-15 20:19:32 +08:00
committed by zeripath
parent d7d348ea86
commit 8c909820a9
10 changed files with 316 additions and 39 deletions

View File

@@ -0,0 +1,9 @@
{{range .Attachments}}
<a target="_blank" rel="noopener noreferrer" href="{{AppSubUrl}}/attachments/{{.UUID}}">
{{if FilenameIsImage .Name}}
<img class="ui image" src="{{AppSubUrl}}/attachments/{{.UUID}}" title='{{$.ctx.i18n.Tr "repo.issues.attachment.open_tab" .Name}}'>
{{else}}
<span class="ui image octicon octicon-desktop-download" title='{{$.ctx.i18n.Tr "repo.issues.attachment.download" .Name}}'></span>
{{end}}
</a>
{{end}}

View File

@@ -55,7 +55,7 @@
{{end}}
</div>
<div class="raw-content hide">{{.Content}}</div>
<div class="edit-content-zone hide" data-write="issuecomment-{{.ID}}-write" data-preview="issuecomment-{{.ID}}-preview" data-update-url="{{$.RepoLink}}/comments/{{.ID}}" data-context="{{$.RepoLink}}"></div>
<div class="edit-content-zone hide" data-write="issuecomment-{{.ID}}-write" data-preview="issuecomment-{{.ID}}-preview" data-update-url="{{$.RepoLink}}/comments/{{.ID}}" data-context="{{$.RepoLink}}" data-attachment-url="{{$.RepoLink}}/comments/{{.ID}}/attachments"></div>
</div>
{{$reactions := .Reactions.GroupByType}}
{{if $reactions}}
@@ -66,15 +66,7 @@
{{if .Attachments}}
<div class="ui bottom attached segment">
<div class="ui small images">
{{range .Attachments}}
<a target="_blank" rel="noopener noreferrer" href="{{AppSubUrl}}/attachments/{{.UUID}}">
{{if FilenameIsImage .Name}}
<img class="ui image" src="{{AppSubUrl}}/attachments/{{.UUID}}" title='{{$.i18n.Tr "repo.issues.attachment.open_tab" .Name}}'>
{{else}}
<span class="ui image octicon octicon-desktop-download" title='{{$.i18n.Tr "repo.issues.attachment.download" .Name}}'></span>
{{end}}
</a>
{{end}}
{{template "repo/issue/view_content/attachments" Dict "ctx" $ "Attachments" .Attachments}}
</div>
</div>
{{end}}