mirror of
https://github.com/go-gitea/gitea.git
synced 2026-09-07 21:43:23 +09:00
enhance(web): show attachment URL and UUID in dropzone preview (#39203)
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
This commit is contained in:
co-authored by
wxiaoguang
parent
eb501f6b19
commit
bde1af541c
@@ -255,7 +255,7 @@
|
||||
</div>
|
||||
{{if .IsAttachmentEnabled}}
|
||||
<div class="field">
|
||||
{{template "repo/upload" .}}
|
||||
{{template "repo/upload" dict "UploadOptions" $.UploadOptions}}
|
||||
</div>
|
||||
{{end}}
|
||||
<div class="field flex-text-block tw-justify-end">
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
</div>
|
||||
{{if $.root.IsAttachmentEnabled}}
|
||||
<div class="field">
|
||||
{{template "repo/upload" $.root}}
|
||||
{{template "repo/upload" dict "UploadOptions" ctx.RootData.UploadOptions}}
|
||||
</div>
|
||||
{{end}}
|
||||
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
</div>
|
||||
{{if .IsAttachmentEnabled}}
|
||||
<div class="field">
|
||||
{{template "repo/upload" .}}
|
||||
{{template "repo/upload" dict "UploadOptions" $.UploadOptions}}
|
||||
</div>
|
||||
{{end}}
|
||||
<div class="divider"></div>
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
{{template "repo/editor/common_breadcrumb" .}}
|
||||
</div>
|
||||
<div class="field">
|
||||
{{template "repo/upload" .}}
|
||||
{{template "repo/upload" dict "UploadOptions" $.UploadOptions}}
|
||||
</div>
|
||||
{{template "repo/editor/commit_form" .}}
|
||||
</form>
|
||||
|
||||
@@ -16,6 +16,6 @@
|
||||
|
||||
{{if .IsAttachmentEnabled}}
|
||||
<div class="field">
|
||||
{{template "repo/upload" .}}
|
||||
{{template "repo/upload" dict "UploadOptions" $.UploadOptions}}
|
||||
</div>
|
||||
{{end}}
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
|
||||
{{if .root.IsAttachmentEnabled}}
|
||||
<div class="tw-mt-4 form-field-dropzone tw-hidden">{{/*TODO: need to refactor the "repo/upload" template and remove this wrapper */}}
|
||||
{{template "repo/upload" .root}}
|
||||
{{template "repo/upload" dict "UploadOptions" ctx.RootData.UploadOptions}}
|
||||
</div>
|
||||
{{end}}
|
||||
{{end}}
|
||||
|
||||
@@ -156,7 +156,7 @@
|
||||
|
||||
{{if .IsAttachmentEnabled}}
|
||||
<div class="field">
|
||||
{{template "repo/upload" .}}
|
||||
{{template "repo/upload" dict "UploadOptions" $.UploadOptions}}
|
||||
</div>
|
||||
{{end}}
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
{{else}}
|
||||
{{$referenceHTMLURL = printf "%s/files#%s" $issueHTMLURL .item.HashTag}}
|
||||
{{end}}
|
||||
<div class="item context js-aria-clickable" data-clipboard-text="{{$referenceHTMLURL}}">{{ctx.Locale.Tr "repo.issues.context.copy_link"}}</div>
|
||||
<div class="item context js-aria-clickable" data-clipboard-text="{{$referenceHTMLURL}}">{{ctx.Locale.Tr "copy_link"}}</div>
|
||||
<div class="item context js-aria-clickable" data-clipboard-target="#{{.item.HashTag}}-raw">{{ctx.Locale.Tr "repo.issues.context.copy_source"}}</div>
|
||||
{{if ctx.RootData.IsSigned}}
|
||||
{{$needDivider := false}}
|
||||
|
||||
@@ -94,7 +94,7 @@
|
||||
{{end}}
|
||||
{{if .IsAttachmentEnabled}}
|
||||
<div class="field">
|
||||
{{template "repo/upload" .}}
|
||||
{{template "repo/upload" dict "UploadOptions" $.UploadOptions}}
|
||||
</div>
|
||||
{{end}}
|
||||
|
||||
|
||||
+14
-10
@@ -1,15 +1,19 @@
|
||||
{{$opts := $.UploadOptions}}
|
||||
<div
|
||||
class="dropzone"
|
||||
data-link-url="{{.UploadLinkUrl}}"
|
||||
data-upload-url="{{.UploadUrl}}"
|
||||
data-remove-url="{{.UploadRemoveUrl}}"
|
||||
data-accepts="{{.UploadAccepts}}"
|
||||
data-max-file="{{.UploadMaxFiles}}"
|
||||
data-max-size="{{.UploadMaxSize}}"
|
||||
data-default-message="{{ctx.Locale.Tr "dropzone.default_message"}}"
|
||||
data-invalid-input-type="{{ctx.Locale.Tr "dropzone.invalid_input_type"}}"
|
||||
data-file-too-big="{{ctx.Locale.Tr "dropzone.file_too_big"}}"
|
||||
data-remove-file="{{ctx.Locale.Tr "dropzone.remove_file"}}"
|
||||
data-link-url="{{$opts.UploadLinkUrl}}"
|
||||
data-upload-url="{{$opts.UploadUrl}}"
|
||||
data-remove-url="{{$opts.UploadRemoveUrl}}"
|
||||
data-accepts="{{$opts.UploadAccepts}}"
|
||||
data-max-file="{{$opts.UploadMaxFiles}}"
|
||||
data-max-size="{{$opts.UploadMaxSize}}"
|
||||
data-need-uuid-link="{{$opts.NeedUuidLink}}"
|
||||
|
||||
data-text-default-message="{{ctx.Locale.Tr "dropzone.default_message"}}"
|
||||
data-text-invalid-input-type="{{ctx.Locale.Tr "dropzone.invalid_input_type"}}"
|
||||
data-text-file-too-big="{{ctx.Locale.Tr "dropzone.file_too_big"}}"
|
||||
data-text-remove-file="{{ctx.Locale.Tr "dropzone.remove_file"}}"
|
||||
data-text-copy-link="{{ctx.Locale.Tr "copy_link"}}"
|
||||
>
|
||||
<div class="files"></div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user