mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2025-10-21 21:03:22 +00:00
@@ -33,6 +33,8 @@
|
||||
{{ end }}
|
||||
</select>
|
||||
<input class="form-control form-control-xlarge" type="text" name="Domain" value="{{.Settings.Domain}}" />
|
||||
<label>Open invitations:</label>
|
||||
<input class="form-control form-control-xlarge" type="checkbox" name="OpenInvitations" {{ if .Settings.OpenInvitations }} checked {{ end }} /> enable open invintation requests from users
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="alert">GitHub OAuth Consumer Key and Secret</div>
|
||||
|
@@ -10,6 +10,9 @@
|
||||
<input type="submit" value="Sign in" />
|
||||
</div>
|
||||
<div>
|
||||
{{ if .Settings.OpenInvitations }}
|
||||
<a href="/signup">request invitation</a>
|
||||
{{ end }}
|
||||
<a href="/forgot">forgot password</a>
|
||||
</div>
|
||||
{{ end }}
|
||||
|
51
pkg/template/pages/signup.html
Normal file
51
pkg/template/pages/signup.html
Normal file
@@ -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" />
|
||||
</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 enabled. In order to invite the user, you'll need to provide them the following link:<br><span class='url'>" + this.responseText + "</span>";
|
||||
}
|
||||
$("#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 }}
|
@@ -45,6 +45,7 @@ func init() {
|
||||
"forgot.html",
|
||||
"forgot_sent.html",
|
||||
"reset.html",
|
||||
"signup.html",
|
||||
"register.html",
|
||||
"install.html",
|
||||
|
||||
|
Reference in New Issue
Block a user