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