attachment edit view download

This commit is contained in:
Yuri Kuznetsov
2021-05-31 13:31:32 +03:00
parent f30bfb20ef
commit 5da4e9f4a8
3 changed files with 18 additions and 2 deletions
@@ -367,7 +367,7 @@ define('views/fields/attachment-multiple', 'views/fields/base', function (Dep) {
return preview;
},
addAttachmentBox: function (name, type, id, link) {
addAttachmentBox: function (name, type, id) {
id = Handlebars.Utils.escapeExpression(id);
var $attachments = this.$attachments;
@@ -383,7 +383,7 @@ define('views/fields/attachment-multiple', 'views/fields/base', function (Dep) {
preview = Handlebars.Utils.escapeExpression(preview);
}
if (link && preview === name) {
if (preview === name && id) {
preview = '<a href="' + this.getBasePath() + '?entryPoint=download&id=' + id + '" target="_BLANK">' +
preview + '</a>';
}
+6
View File
@@ -531,12 +531,18 @@ define('views/fields/file', 'views/fields/link', function (Dep) {
'<span class="fas fa-times"></span></a>';
var preview = name;
if (this.showPreview && id) {
preview = this.getEditPreview(name, type, id);
} else {
preview = Handlebars.Utils.escapeExpression(preview);
}
if (preview === name && id) {
preview = '<a href="' + this.getBasePath() + '?entryPoint=download&id=' + id + '" target="_BLANK">' +
preview + '</a>';
}
var $att = $('<div>')
.append(removeLink)
.append(
+10
View File
@@ -1539,11 +1539,21 @@ label.attach-file-label {
display: inline-block;
width: 100%;
max-width: 300px;
&.preview {
a {
color: @text-color;
}
}
}
.gray-box .preview {
overflow: hidden;
overflow-wrap: break-word;
a {
color: @text-color;
}
}
.attachment-preview {