brotherton-erpnext/erpnext/templates/includes/footer_extension.html

42 lines
1.3 KiB
HTML
Raw Normal View History

2013-11-21 12:58:25 +00:00
<div class="container">
<div class="row">
2014-04-22 11:22:11 +00:00
<div class="col-sm-6 col-sm-offset-3" style="margin-top: 7px;">
<div class="input-group">
<input class="form-control" type="text" id="footer-subscribe-email"
placeholder="{{ _('Your email address') }}...">
<span class="input-group-btn">
<button class="btn btn-default" type="button"
id="footer-subscribe-button">{{ _("Stay Updated") }}</button>
</span>
</div>
2013-11-21 12:58:25 +00:00
</div>
</div>
2013-09-10 06:48:58 +00:00
</div>
<script>
$("#footer-subscribe-button").click(function() {
if($("#footer-subscribe-email").val()) {
$("#footer-subscribe-email").attr('disabled', true);
$("#footer-subscribe-button").html("Sending...")
.attr("disabled", true);
2013-09-10 06:48:58 +00:00
erpnext.send_message({
subject:"Subscribe me",
sender: $("#footer-subscribe-email").val(),
message: "Subscribe to newsletter (via website footer).",
callback: function(r) {
if(!r.exc) {
$("#footer-subscribe-button").html("Thank You :)")
.addClass("btn-success").attr("disabled", true);
} else {
$("#footer-subscribe-button").html("Error :( Not a valid id?")
.addClass("btn-danger").attr("disabled", false);
$("#footer-subscribe-email").val("").attr('disabled', false);
}
}
});
}
else
2014-02-14 10:17:51 +00:00
frappe.msgprint(frappe._("Please enter email address"))
2013-09-10 06:48:58 +00:00
});
</script>