github.com/marinho/drone@v0.2.1-0.20140504195434-d3ba962e89a7/pkg/template/pages/user_teams_add.html (about) 1 {{ define "title" }}Profile{{ end }} 2 3 {{ define "content" }} 4 5 <div class="subhead"> 6 <div class="container"> 7 <ul class="nav nav-tabs pull-right"> 8 <li><a href="/dashboard">Dashboard</a></li> 9 <li class="active"><a href="/account/user/profile">Settings</a></li> 10 </ul> <!-- ./nav --> 11 <h1 class="user"> 12 <img src="{{.User.Image}}"> 13 <span>{{.User.Name}}</span> 14 </h1> 15 </div><!-- ./container --> 16 </div><!-- ./subhead --> 17 18 19 <div class="container"> 20 <div class="row"> 21 22 <div class="col-xs-3"> 23 <ul class="nav nav-pills nav-stacked"> 24 <li><a href="/account/user/profile">Profile</a></li> 25 <li><a href="/account/user/password">Password</a></li> 26 <li class="active"><a href="/account/user/teams">Teams</a></li> 27 <li><a href="/account/user/delete">Delete</a></li> 28 </ul> 29 </div><!-- ./col-xs-3 --> 30 31 <div class="col-xs-9" role="main" style="padding-left:20px;"> 32 <div class="alert">Setup a new Team Account.</div> 33 34 <div class="col-xs-5"> 35 <form action="/account/user/teams/add" method="POST" role="form"> 36 <label>Team Name:</label> 37 <div> 38 <input class="form-control" type="text" name="name" value="" /> 39 </div> 40 <label>Email (Gravatar):</label> 41 <div> 42 <input class="form-control" type="text" name="email" value="" /> 43 </div> 44 <div class="alert alert-success hide" id="successAlert"></div> 45 <div class="alert alert-error hide" id="failureAlert"></div> 46 <div class="form-actions"> 47 <input class="btn btn-primary" id="submitButton" type="submit" value="Save" data-loading-text="Saving .." /> 48 <a class="btn btn-default" href="/account/user/teams">Cancel</a> 49 </div> 50 </form> 51 </div> 52 53 </div><!-- ./col-xs-9 --> 54 </div><!-- ./row --> 55 56 </div><!-- ./container --> 57 {{ end }} 58 59 {{ define "script" }} 60 <script> 61 document.forms[0].onsubmit = function(event) { 62 $("#successAlert").hide(); 63 $("#failureAlert").hide(); 64 $('#submitButton').button('loading'); 65 66 var form = event.target; 67 var formData = new FormData(form); 68 xhr = new XMLHttpRequest(); 69 xhr.open('POST', form.action); 70 xhr.onload = function() { 71 if (this.status == 200) { 72 $("#successAlert").text("Your team account was successfully created."); 73 $("#successAlert").show().removeClass("hide"); 74 $('#submitButton').button('reset'); 75 } else { 76 $("#failureAlert").text("Failed to create the Team account. " + this.response); 77 $("#failureAlert").show().removeClass("hide"); 78 $('#submitButton').button('reset') 79 }; 80 }; 81 xhr.send(formData); 82 return false; 83 } 84 </script> 85 {{ end }}