github.com/marinho/drone@v0.2.1-0.20140504195434-d3ba962e89a7/pkg/template/pages/members_edit.html (about) 1 {{ define "title" }}{{.Team.Name}} ยท Edit Member{{ 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.Slug}}</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">Edit Team Membership for <strong>{{.Member.Name}}</strong></div> 36 <div class="row"> 37 <div class="col-xs-5"> 38 <form method="POST" role="form" action="/account/team/{{.Team.Slug}}/members/edit?id={{.Member.ID}}"> 39 <label>Full Name:</label> 40 <div> 41 <span class="form-control">{{.Member.Name}}</span> 42 </div> 43 <label>Role:</label> 44 <div> 45 <select class="form-control" name="Role"> 46 <option value="Owner">Owner</option> 47 <option value="Admin">Admin</option> 48 <option value="Write">Write</option> 49 <option value="Read">Read</option> 50 <option value="{{.Member.Role}}" selected="true">{{.Member.Role}}</option> 51 </select> 52 </div> 53 <div class="alert alert-success hide" id="successAlert"></div> 54 <div class="alert alert-error hide" id="failureAlert"></div> 55 <div class="form-actions"> 56 <input class="btn btn-primary" id="submitButton" type="submit" value="Save" data-loading-text="Saving .." /> 57 <a class="btn btn-default" href="/account/team/{{.Team.Slug}}/members">Cancel</a> 58 </div> 59 60 </form> 61 </div> 62 <div class="col-xs-7"> 63 <a class="avatar-link" href="https://gravatar.com/" target="_blank"> 64 <img src="{{.Member.ImageLarge}}" /> 65 </a> 66 </div> 67 </div> 68 69 <form method="POST" action="/account/team/{{.Team.Slug}}/members/delete?id={{.Member.ID}}"> 70 <div class="alert alert-upgrade"> 71 <input class="btn btn-danger pull-right" type="submit" value="Delete" /> 72 <div> 73 <strong>Warning</strong> 74 <span>this action cannot be undone.</span> 75 </div> 76 </div> 77 </form> 78 </div><!-- ./col-xs-9 --> 79 </div><!-- ./row --> 80 81 </div><!-- ./container --> 82 {{ end }} 83 84 {{ define "script" }} 85 <script> 86 document.forms[0].onsubmit = function(event) { 87 $("#successAlert").hide(); 88 $("#failureAlert").hide(); 89 $('#submitButton').button('loading'); 90 91 var form = event.target; 92 var formData = new FormData(form); 93 xhr = new XMLHttpRequest(); 94 xhr.open('POST', form.action); 95 xhr.onload = function() { 96 if (this.status == 200) { 97 $("#successAlert").text("The Team Member's Role was successfully updated."); 98 $("#successAlert").show().removeClass("hide"); 99 $('#submitButton').button('reset') 100 } else { 101 $("#failureAlert").text("Failed to update the Team Member's Role. "+this.response); 102 $("#failureAlert").show().removeClass("hide"); 103 $('#submitButton').button('reset') 104 }; 105 }; 106 xhr.send(formData); 107 return false; 108 } 109 </script> 110 {{ end }}