Rushabh Mehta | 4c6120a | 2013-09-10 12:18:58 +0530 | [diff] [blame] | 1 | {% extends "lib/website/templates/includes/footer.html" %} |
| 2 | |
Anand Doshi | b866a9b | 2013-11-21 17:03:41 +0530 | [diff] [blame] | 3 | {% block powered %}<small><a href="http://erpnext.org" class="text-muted">ERPNext Powered</a></small>{% endblock %} |
Rushabh Mehta | 4c6120a | 2013-09-10 12:18:58 +0530 | [diff] [blame] | 4 | |
| 5 | {% block extension %} |
Anand Doshi | b866a9b | 2013-11-21 17:03:41 +0530 | [diff] [blame] | 6 | <div class="input-group col-md-6 col-md-offset-3" style="margin-top: 15px;"> |
Rushabh Mehta | 4c6120a | 2013-09-10 12:18:58 +0530 | [diff] [blame] | 7 | <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 %} |