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