2014-02-13 12:08:20 +03:00
|
|
|
{{ define "title" }}Sign up · drone.io{{ end }}
|
|
|
|
|
|
|
|
{{ define "content" }}
|
|
|
|
<h1>Sign up</h1>
|
|
|
|
<form action="/signup" method="POST" role="form">
|
2014-02-16 04:56:48 +03:00
|
|
|
<div class="alert alert-success hide" id="successAlert"></div>
|
|
|
|
<div class="alert alert-error hide" id="failureAlert"></div>
|
2014-02-13 12:08:20 +03:00
|
|
|
<div>
|
2014-02-13 16:43:30 +03:00
|
|
|
<input type="text" name="email" placeholder="Email address" autocomplete="off" spellcheck="false" class="form-control only-child" />
|
2014-02-13 12:08:20 +03:00
|
|
|
</div>
|
|
|
|
<div>
|
2014-02-16 04:56:48 +03:00
|
|
|
<input type="submit" id="submitButton" value="Request invite" data-loading-text="Sending Invite .." />
|
2014-02-13 12:08:20 +03:00
|
|
|
</div>
|
|
|
|
</form>
|
|
|
|
{{ end }}
|
|
|
|
|
|
|
|
{{ define "script" }}
|
|
|
|
<script>
|
|
|
|
document.forms[0].onsubmit = function(event) {
|
|
|
|
|
|
|
|
$("#successAlert").hide();
|
|
|
|
$("#failureAlert").hide();
|
|
|
|
$('#submitButton').button('loading');
|
|
|
|
|
|
|
|
var form = event.target
|
|
|
|
var formData = new FormData(form);
|
|
|
|
xhr = new XMLHttpRequest();
|
|
|
|
xhr.open('POST', form.action);
|
|
|
|
xhr.onload = function() {
|
|
|
|
if (this.status == 200) {
|
2014-02-16 04:56:48 +03:00
|
|
|
$("#successAlert").text("User Invitation was sent successfully");
|
2014-02-13 12:08:20 +03:00
|
|
|
$("#successAlert").show().removeClass("hide");
|
|
|
|
$('#submitButton').button('reset')
|
|
|
|
|
|
|
|
} else {
|
|
|
|
$("#failureAlert").text("Failed to send Invitation Email. " + this.response);
|
|
|
|
$("#failureAlert").show().removeClass("hide");
|
|
|
|
$('#submitButton').button('reset')
|
|
|
|
};
|
|
|
|
};
|
|
|
|
xhr.send(formData);
|
|
|
|
return false;
|
2014-02-16 04:56:48 +03:00
|
|
|
}
|
2014-02-13 12:08:20 +03:00
|
|
|
</script>
|
|
|
|
{{ end }}
|