brotherton-erpnext/erpnext/templates/includes/footer/footer_extension.html

45 lines
1.5 KiB
HTML
Raw Normal View History

2015-05-25 05:21:01 +00:00
{% if not hide_footer_signup %}
<div class="container">
<div class="row">
<div class="col-sm-6 col-sm-offset-3 text-center" style="margin-top: 15px;">
<input class="form-control" type="text" id="footer-subscribe-email"
style="display: inline-block; max-width: 50%; margin-right: 10px;"
placeholder="{{ _('Your email address') }}...">
<button class="btn btn-default btn-sm" type="button"
id="footer-subscribe-button">{{ _("Get Updates") }}</button>
</div>
</div>
<div class="text-center text-muted small" style="padding: 30px;">
<a href="https://erpnext.com?source=website_footer" target="_blank" class="text-extra-muted">
Powered by ERPNext</a>
</div>
</div>
<script>
2016-01-01 11:53:12 +00:00
frappe.ready(function() {
2015-05-25 05:21:01 +00:00
$("#footer-subscribe-button").click(function() {
if($("#footer-subscribe-email").val()) {
$("#footer-subscribe-email").attr('disabled', true);
$("#footer-subscribe-button").html("Sending...")
.attr("disabled", true);
erpnext.subscribe_to_newsletter({
email: $("#footer-subscribe-email").val(),
callback: function(r) {
if(!r.exc) {
$("#footer-subscribe-button").html(__("Added"))
.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);
}
}
});
}
else
frappe.msgprint(frappe._("Please enter email address"))
});
2016-01-01 11:53:12 +00:00
});
2015-05-25 05:21:01 +00:00
</script>
{% endif %}