Possibility to go to file manager from sidebard (#5816)
* Possibility to go to file from sidebard * Refactor to use microtemplating
This commit is contained in:
parent
c9b36c63dd
commit
b175ac407f
3 changed files with 18 additions and 13 deletions
|
|
@ -265,7 +265,7 @@
|
|||
"public/js/frappe/form/user_image.js",
|
||||
"public/js/frappe/form/share.js",
|
||||
"public/js/frappe/form/form_viewers.js",
|
||||
|
||||
"public/js/frappe/form/footer/attachment.html",
|
||||
"public/js/frappe/form/footer/form_footer.html",
|
||||
"public/js/frappe/form/footer/timeline.html",
|
||||
"public/js/frappe/form/footer/timeline_item.html",
|
||||
|
|
|
|||
10
frappe/public/js/frappe/form/footer/attachment.html
Normal file
10
frappe/public/js/frappe/form/footer/attachment.html
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
<li class="attachment-row">
|
||||
<a class="close">×</a>
|
||||
<a href="{{ file_path }}">
|
||||
<i class="{{ icon }} fa-fw text-warning"></i>
|
||||
</a>
|
||||
<a href="{{ file_url }}" target="_blank" title="{{ file_name }}" class="ellipsis" style="max-width: calc(100% - 43px);">
|
||||
<span>{{ file_name }}</span>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
|
@ -62,18 +62,13 @@ frappe.ui.form.Attachments = Class.extend({
|
|||
}
|
||||
|
||||
var me = this;
|
||||
var $attach = $(repl('<li class="attachment-row">\
|
||||
<a class="close">×</a>\
|
||||
%(lock_icon)s\
|
||||
<a href="%(file_url)s" target="_blank" title="%(file_name)s" \
|
||||
class="ellipsis" style="max-width: calc(100% - 43px);">\
|
||||
<span>%(file_name)s</span></a>\
|
||||
</li>', {
|
||||
lock_icon: attachment.is_private ? '<i class="fa fa-lock fa-fw text-warning"></i> ': "",
|
||||
file_name: file_name,
|
||||
file_url: frappe.urllib.get_full_url(file_url)
|
||||
}))
|
||||
.insertAfter(this.attachments_label.addClass("has-attachments"));
|
||||
|
||||
var $attach = $(frappe.render_template("attachment", {
|
||||
"file_path": "/desk#Form/File/" + fileid,
|
||||
"icon": attachment.is_private ? "fa fa-lock" : "fa fa-unlock-alt",
|
||||
"file_name": file_name,
|
||||
"file_url": frappe.urllib.get_full_url(file_url)
|
||||
})).insertAfter(this.attachments_label.addClass("has-attachments"));
|
||||
|
||||
var $close =
|
||||
$attach.find(".close")
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue