diff --git a/frappe/public/build.json b/frappe/public/build.json
index 11a043959c..d4fec8766e 100755
--- a/frappe/public/build.json
+++ b/frappe/public/build.json
@@ -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",
diff --git a/frappe/public/js/frappe/form/footer/attachment.html b/frappe/public/js/frappe/form/footer/attachment.html
new file mode 100644
index 0000000000..3598f8b9ef
--- /dev/null
+++ b/frappe/public/js/frappe/form/footer/attachment.html
@@ -0,0 +1,10 @@
+
+ ×
+
+
+
+
+ {{ file_name }}
+
+
+
diff --git a/frappe/public/js/frappe/form/footer/attachments.js b/frappe/public/js/frappe/form/footer/attachments.js
index f9f1a29551..ae41525417 100644
--- a/frappe/public/js/frappe/form/footer/attachments.js
+++ b/frappe/public/js/frappe/form/footer/attachments.js
@@ -62,18 +62,13 @@ frappe.ui.form.Attachments = Class.extend({
}
var me = this;
- var $attach = $(repl('\
- ×\
- %(lock_icon)s\
- \
- %(file_name)s\
- ', {
- lock_icon: attachment.is_private ? ' ': "",
- 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")