-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #67 from floatdrop/open-invitations
Open invitation setting
- Loading branch information
Showing
11 changed files
with
101 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
{{ define "title" }}Sign up · drone.io{{ end }} | ||
|
||
{{ define "content" }} | ||
<h1>Sign up</h1> | ||
<form action="/signup" method="POST" role="form"> | ||
<div> | ||
<input type="text" name="email" placeholder="Email address" autocomplete="off" spellcheck="false" class="form-control only-child" /> | ||
</div> | ||
<div> | ||
<div class="alert alert-success hide" id="successAlert"></div> | ||
<div class="alert alert-error hide" id="failureAlert"></div> | ||
</div> | ||
<div> | ||
<input type="submit" id="submitButton" value="Request invite" /> | ||
</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) { | ||
var msg = "User Invitation was sent successfully"; | ||
if (this.responseText != "OK") { | ||
msg = "Email is not currently enables. Follow the link:<br><a href='" + this.responseText + "'>" + this.responseText + "</a>"; | ||
} | ||
$("#successAlert").html(msg); | ||
$("#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; | ||
} | ||
</script> | ||
{{ end }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters