github.com/marinho/drone@v0.2.1-0.20140504195434-d3ba962e89a7/pkg/template/pages/signup.html (about) 1 {{ define "title" }}Sign up ยท drone.io{{ end }} 2 3 {{ define "content" }} 4 <h1>Sign up</h1> 5 <form action="/signup" method="POST" role="form"> 6 <div class="alert alert-success hide" id="successAlert"></div> 7 <div class="alert alert-error hide" id="failureAlert"></div> 8 <div> 9 <input type="text" name="email" placeholder="Email address" autocomplete="off" spellcheck="false" class="form-control only-child" /> 10 </div> 11 <div> 12 <input type="submit" id="submitButton" value="Request invite" data-loading-text="Sending Invite .." /> 13 </div> 14 </form> 15 {{ end }} 16 17 {{ define "script" }} 18 <script> 19 document.forms[0].onsubmit = function(event) { 20 21 $("#successAlert").hide(); 22 $("#failureAlert").hide(); 23 $('#submitButton').button('loading'); 24 25 var form = event.target 26 var formData = new FormData(form); 27 xhr = new XMLHttpRequest(); 28 xhr.open('POST', form.action); 29 xhr.onload = function() { 30 if (this.status == 200) { 31 $("#successAlert").text("User Invitation was sent successfully"); 32 $("#successAlert").show().removeClass("hide"); 33 $('#submitButton').button('reset') 34 35 } else { 36 $("#failureAlert").text("Failed to send Invitation Email. " + this.response); 37 $("#failureAlert").show().removeClass("hide"); 38 $('#submitButton').button('reset') 39 }; 40 }; 41 xhr.send(formData); 42 return false; 43 } 44 </script> 45 {{ end }}