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

94 lines
No EOL
3 KiB
HTML

{{ define "title" }}{{.Team.Name}} · Profile{{ end }}
{{ define "content" }}
<div class="subhead">
<div class="container">
<ul class="nav nav-tabs pull-right">
<li>
<a href="/dashboard/team/{{.Team.Slug}}">Dashboard</a>
</li>
<li class="active">
<a href="/account/team/{{.Team.Slug}}/profile">Team Settings</a>
</li>
</ul> <!-- ./nav -->
<h1 class="user">
<img src="{{.Team.Image}}">
<span>{{.Team.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 class="active"><a href="/account/team/{{.Team.Slug}}/profile">Profile</a></li>
<li><a href="/account/team/{{.Team.Slug}}/members">Members</a></li>
<li><a href="/account/team/{{.Team.Slug}}/delete">Delete</a></li>
</ul>
</div><!-- ./col-xs-3 -->
<div class="col-xs-9" role="main" style="padding-left:20px;">
<div class="alert">Manage your team's Profile.</div>
<div class="col-xs-5">
<form action="/account/team/{{.Team.Slug}}/profile" method="POST" role="form">
<label>Team Name:</label>
<div>
<input class="form-control" type="text" name="name" value="{{.Team.Name}}" />
</div>
<label>Gravatar Email Address:</label>
<div>
<input class="form-control" type="text" name="email" value="{{.Team.Email}}" />
</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/team/{{.Team.Slug}}/profile">Cancel</a>
</div>
</form>
</div>
<div class="col-xs-7">
<a class="avatar-link" href="https://gravatar.com/" target="_blank">
<img src="{{.Team.ImageLarge}}" />
<span>edit gravatar</span>
</a>
</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("The Team profile was successfully updated");
$("#successAlert").show().removeClass("hide");
$('#submitButton').button('reset')
} else {
$("#failureAlert").text("Failed to update the Team profile.");
$("#failureAlert").show().removeClass("hide");
$('#submitButton').button('reset');
};
};
xhr.send(formData);
return false;
}
</script>
{{ end }}