blob: 7cba9e30838735645a5084dd3b9f3b3c9a827b97 [file] [log] [blame]
Rushabh Mehta4c6120a2013-09-10 12:18:58 +05301{% extends "lib/website/templates/includes/footer.html" %}
2
Anand Doshib866a9b2013-11-21 17:03:41 +05303{% block powered %}<small><a href="http://erpnext.org" class="text-muted">ERPNext Powered</a></small>{% endblock %}
Rushabh Mehta4c6120a2013-09-10 12:18:58 +05304
5{% block extension %}
Anand Doshib866a9b2013-11-21 17:03:41 +05306<div class="input-group col-md-6 col-md-offset-3" style="margin-top: 15px;">
Rushabh Mehta4c6120a2013-09-10 12:18:58 +05307 <input class="form-control" type="text" id="footer-subscribe-email" placeholder="Your email address...">
8 <span class="input-group-btn">
9 <button class="btn btn-default" type="button" id="footer-subscribe-button">Stay Updated</button>
10 </span>
11</div>
12<br>
13<script>
14 $("#footer-subscribe-button").click(function() {
15
16 $("#footer-subscribe-email").attr('disabled', true);
17 $("#footer-subscribe-button").html("Sending...")
18 .attr("disabled", true);
19
20 if($("#footer-subscribe-email").val()) {
21 erpnext.send_message({
22 subject:"Subscribe me",
23 sender: $("#footer-subscribe-email").val(),
24 message: "Subscribe to newsletter (via website footer).",
25 callback: function(r) {
26 if(!r.exc) {
27 $("#footer-subscribe-button").html("Thank You :)")
28 .addClass("btn-success").attr("disabled", true);
29 } else {
30 $("#footer-subscribe-button").html("Error :( Not a valid id?")
31 .addClass("btn-danger").attr("disabled", false);
32 $("#footer-subscribe-email").val("").attr('disabled', false);
33 }
34 }
35 });
36 }
37 });
38</script>
39{% endblock %}