mirror of
https://github.com/frappe/erpnext.git
synced 2026-06-07 15:12:51 +00:00
website_settings: added button to generate html banner
This commit is contained in:
@@ -42,3 +42,13 @@ $.extend(cur_frm.cscript, {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
cur_frm.cscript.set_banner_from_image = function(doc) {
|
||||||
|
if(!doc.banner_image) {
|
||||||
|
msgprint(wn._("Select a Banner Image first."));
|
||||||
|
}
|
||||||
|
var src = doc.banner_image;
|
||||||
|
if(src.indexOf("/")==-1) src = "files/" + src;
|
||||||
|
cur_frm.set_value("banner_html", "<a href='/'><img src='"+ src
|
||||||
|
+"'></a>");
|
||||||
|
}
|
||||||
@@ -2,7 +2,7 @@
|
|||||||
{
|
{
|
||||||
"creation": "2013-03-07 11:55:11",
|
"creation": "2013-03-07 11:55:11",
|
||||||
"docstatus": 0,
|
"docstatus": 0,
|
||||||
"modified": "2013-03-12 11:17:11",
|
"modified": "2013-03-13 16:25:22",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"owner": "Administrator"
|
"owner": "Administrator"
|
||||||
},
|
},
|
||||||
@@ -78,6 +78,20 @@
|
|||||||
"fieldtype": "Section Break",
|
"fieldtype": "Section Break",
|
||||||
"label": "Banner"
|
"label": "Banner"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"description": "Select an image of approx width 150px with a transparent background for best results.",
|
||||||
|
"doctype": "DocField",
|
||||||
|
"fieldname": "banner_image",
|
||||||
|
"fieldtype": "Select",
|
||||||
|
"label": "Banner Image",
|
||||||
|
"options": "attach_files:"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"doctype": "DocField",
|
||||||
|
"fieldname": "set_banner_from_image",
|
||||||
|
"fieldtype": "Button",
|
||||||
|
"label": "Set Banner from Image"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"description": "Banner is above the Top Menu Bar.",
|
"description": "Banner is above the Top Menu Bar.",
|
||||||
"doctype": "DocField",
|
"doctype": "DocField",
|
||||||
|
|||||||
Reference in New Issue
Block a user