mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-26 00:14:50 +00:00
moved directory structure
This commit is contained in:
33
website/templates/js/blog_subscribe.js
Normal file
33
website/templates/js/blog_subscribe.js
Normal file
@@ -0,0 +1,33 @@
|
||||
wn.provide('erpnext.blog');
|
||||
|
||||
(function() {
|
||||
$('body').on('click', '.btn-blog-subscribe', function() {
|
||||
var d = new wn.ui.Dialog({
|
||||
title: "Get Blog Updates via Email",
|
||||
fields: [
|
||||
{label: "Your Name", fieldtype:"Data", reqd:1},
|
||||
{label: "Your Email Address", fieldtype:"Data", reqd:1
|
||||
,description: "You can unsubscribe anytime."},
|
||||
{label: "Subscribe", fieldtype:"Button"}
|
||||
]
|
||||
});
|
||||
$(d.fields_dict.subscribe.input).click(function() {
|
||||
var args = d.get_values();
|
||||
if(!args) return;
|
||||
wn.call({
|
||||
method: 'website.blog.add_subscriber',
|
||||
args: args,
|
||||
callback: function(r) {
|
||||
if(r.exc) {
|
||||
msgprint('Opps there seems to be some error, Please check back after some time.');
|
||||
} else {
|
||||
msgprint('Thanks for subscribing!');
|
||||
}
|
||||
d.hide();
|
||||
},
|
||||
btn: this
|
||||
})
|
||||
})
|
||||
d.show()
|
||||
})
|
||||
})()
|
||||
Reference in New Issue
Block a user