40 lines
1.3 KiB
HTML
Raw Normal View History

2013-09-10 12:18:58 +05:30
{% extends "lib/website/templates/includes/footer.html" %}
2013-11-21 17:03:41 +05:30
{% block powered %}<small><a href="http://erpnext.org" class="text-muted">ERPNext Powered</a></small>{% endblock %}
2013-09-10 12:18:58 +05:30
{% block extension %}
2013-11-21 17:03:41 +05:30
<div class="input-group col-md-6 col-md-offset-3" style="margin-top: 15px;">
2013-09-10 12:18:58 +05:30
<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>
<br>
<script>
$("#footer-subscribe-button").click(function() {
$("#footer-subscribe-email").attr('disabled', true);
$("#footer-subscribe-button").html("Sending...")
.attr("disabled", true);
if($("#footer-subscribe-email").val()) {
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);
}
}
});
}
});
</script>
{% endblock %}