woodpecker/pkg/template/pages/user_teams_add.html
2014-02-07 03:10:01 -07:00

85 lines
No EOL
2.7 KiB
HTML

{{ define "title" }}Profile{{ end }}
{{ define "content" }}
<div class="subhead">
<div class="container">
<ul class="nav nav-tabs pull-right">
<li><a href="/dashboard">Dashboard</a></li>
<li class="active"><a href="/account/user/profile">Settings</a></li>
</ul> <!-- ./nav -->
<h1 class="user">
<img src="{{.User.Image}}">
<span>{{.User.Name}}</span>
</h1>
</div><!-- ./container -->
</div><!-- ./subhead -->
<div class="container">
<div class="row">
<div class="col-xs-3">
<ul class="nav nav-pills nav-stacked">
<li><a href="/account/user/profile">Profile</a></li>
<li><a href="/account/user/password">Password</a></li>
<li class="active"><a href="/account/user/teams">Teams</a></li>
<li><a href="/account/user/delete">Delete</a></li>
</ul>
</div><!-- ./col-xs-3 -->
<div class="col-xs-9" role="main" style="padding-left:20px;">
<div class="alert">Setup a new Team Account.</div>
<div class="col-xs-5">
<form action="/account/user/teams/add" method="POST" role="form">
<label>Team Name:</label>
<div>
<input class="form-control" type="text" name="name" value="" />
</div>
<label>Email (Gravatar):</label>
<div>
<input class="form-control" type="text" name="email" value="" />
</div>
<div class="alert alert-success hide" id="successAlert"></div>
<div class="alert alert-error hide" id="failureAlert"></div>
<div class="form-actions">
<input class="btn btn-primary" id="submitButton" type="submit" value="Save" data-loading-text="Saving .." />
<a class="btn btn-default" href="/account/user/teams">Cancel</a>
</div>
</form>
</div>
</div><!-- ./col-xs-9 -->
</div><!-- ./row -->
</div><!-- ./container -->
{{ 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) {
$("#successAlert").text("Your team account was successfully created.");
$("#successAlert").show().removeClass("hide");
$('#submitButton').button('reset');
} else {
$("#failureAlert").text("Failed to create the Team account. " + this.response);
$("#failureAlert").show().removeClass("hide");
$('#submitButton').button('reset')
};
};
xhr.send(formData);
return false;
}
</script>
{{ end }}