Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

43 lines
1.3 KiB
HTML
Raw Normal View History

2015-05-25 10:51:01 +05:30
{% if not hide_footer_signup %}
<div class="input-group">
2020-12-16 09:43:57 +05:30
<input type="text" class="form-control"
id="footer-subscribe-email"
placeholder="{{ _('Your email address...') }}"
aria-label="{{ _('Your email address...') }}"
aria-describedby="footer-subscribe-button">
<div class="input-group-append">
2020-12-16 09:43:57 +05:30
<button class="btn btn-sm btn-default"
type="button" id="footer-subscribe-button">{{ _("Get Updates") }}</button>
</div>
</div>
2016-04-12 23:58:20 +05:30
2015-05-25 10:51:01 +05:30
<script>
2016-01-01 17:23:12 +05:30
frappe.ready(function() {
2015-05-25 10:51:01 +05:30
$("#footer-subscribe-button").click(function() {
if($("#footer-subscribe-email").val() && validate_email($("#footer-subscribe-email").val())) {
2015-05-25 10:51:01 +05:30
$("#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 valid email address"))
2015-05-25 10:51:01 +05:30
});
2016-01-01 17:23:12 +05:30
});
2015-05-25 10:51:01 +05:30
</script>
2015-05-25 10:51:01 +05:30
{% endif %}