github.com/marinho/drone@v0.2.1-0.20140504195434-d3ba962e89a7/pkg/template/pages/members_add.html (about) 1 {{ define "title" }}{{.Team.Name}} ยท 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> 9 <a href="/dashboard/team/{{.Team.Slug}}">Dashboard</a> 10 </li> 11 <li class="active"> 12 <a href="/account/team/{{.Team.Slug}}/profile">Settings</a> 13 </li> 14 </ul> <!-- ./nav --> 15 <h1 class="user"> 16 <img src="{{.Team.Image}}"> 17 <span>{{.Team.Name}}</span> 18 </h1> 19 </div><!-- ./container --> 20 </div><!-- ./subhead --> 21 22 23 <div class="container"> 24 <div class="row"> 25 26 <div class="col-xs-3"> 27 <ul class="nav nav-pills nav-stacked"> 28 <li><a href="/account/team/{{.Team.Slug}}/profile">Profile</a></li> 29 <li class="active"><a href="/account/team/{{.Team.Slug}}/members">Members</a></li> 30 <li><a href="/account/team/{{.Team.Slug}}/delete">Delete</a></li> 31 </ul> 32 </div><!-- ./col-xs-3 --> 33 34 <div class="col-xs-9" role="main" style="padding-left:20px;"> 35 <div class="alert">Invite a collaborator to join your Team.</div> 36 37 <div class="row"> 38 <form action="/account/team/{{.Team.Slug}}/members/add" method="POST" role="form"> 39 <label>Email Address:</label> 40 <div> 41 <input class="form-control" type="text" name="email" value="" /> 42 </div> 43 <div class="alert alert-success hide" id="successAlert"></div> 44 <div class="alert alert-error hide" id="failureAlert"></div> 45 <div class="form-actions"> 46 <input class="btn btn-primary" id="submitButton" type="submit" value="Invite" data-loading-text="Inviting .." /> 47 <a class="btn btn-default" href="/account/team/{{.Team.Slug}}/members">Cancel</a> 48 </div> 49 </form> 50 </div> 51 </div><!-- ./col-xs-9 --> 52 </div><!-- ./row --> 53 54 </div><!-- ./container --> 55 {{ end }} 56 57 {{ define "script" }} 58 <script> 59 document.forms[0].onsubmit = function(event) { 60 $("#successAlert").hide(); 61 $("#failureAlert").hide(); 62 $('#submitButton').button('loading'); 63 64 var form = event.target 65 var formData = new FormData(form); 66 xhr = new XMLHttpRequest(); 67 xhr.open('POST', form.action); 68 xhr.onload = function() { 69 if (this.status == 200) { 70 var msg = "An invitation has been sent (via email) to join the Team."; 71 if (this.responseText != "OK") { 72 msg = "Email is not currently enabled. In order to invite this team member user, you'll need to provide them the following link:<br><span class='url'>" + this.responseText + "</span>"; 73 } 74 $("#successAlert").html(msg); 75 $("#successAlert").show().removeClass("hide"); 76 $('#submitButton').button('reset') 77 } else { 78 $("#failureAlert").text("Failed to invite the collaborator. Please try again"); 79 $("#failureAlert").show().removeClass("hide"); 80 $('#submitButton').button('reset') 81 }; 82 }; 83 xhr.send(formData); 84 return false; 85 } 86 </script> 87 {{ end }}