github.com/marinho/drone@v0.2.1-0.20140504195434-d3ba962e89a7/pkg/template/pages/bitbucket_add.html (about) 1 {{ define "title" }}Bitbucket ยท Add Repository{{ end }} 2 3 {{ define "content" }} 4 <div class="subhead"> 5 <div class="container"> 6 <h1> 7 <span>Repository Setup</span> 8 <small>Bitbucket</small> 9 </h1> 10 </div><!-- ./container --> 11 </div><!-- ./subhead --> 12 13 <div class="container"> 14 <div class="row"> 15 <div class="col-xs-3"> 16 <ul class="nav nav-pills nav-stacked"> 17 <li><a href="/new/github.com">GitHub</a></li> 18 <li class="active"><a href="/new/bitbucket.org">Bitbucket</a></li> 19 <li><a href="/new/gitlab">GitLab</a></li> 20 </ul> 21 </div><!-- ./col-xs-3 --> 22 23 <div class="col-xs-9" role="main"> 24 <div class="alert"> 25 Enter your repository details 26 <a class="btn btn-default pull-right" href="/auth/login/bitbucket" style="font-size: 18px;background:#f4f4f4;">Re-Link Account</a> 27 </div> 28 <form class="form-repo" method="POST" action="/new/bitbucket.org"> 29 <div class="field-group"> 30 <div> 31 <label>Bitbucket Owner</label> 32 <div> 33 <input class="form-control form-control-large" type="text" name="owner" autocomplete="off"> 34 </div> 35 </div> 36 </div> 37 <div class="field-separator">/</div> 38 <div class="field-group"> 39 <div> 40 <label>Repository Name</label> 41 <div> 42 <input class="form-control form-control-large" type="text" name="name" autocomplete="off"> 43 </div> 44 </div> 45 </div> 46 <br/> 47 <div class="alert">Select your Drone account</div> 48 <ul> 49 <li> 50 <input type="radio" name="team" checked="True" value=""> 51 <img src="{{ .User.Image }}?s=32"> 52 <span>Me</span> 53 </li> 54 {{ range .Teams }} 55 <li> 56 <input type="radio" name="team" value="{{ .Slug }}"> 57 <img src="{{ .Image }}?s=32"> 58 <span>{{ .Name }}</span> 59 </li> 60 {{ end }} 61 </ul> 62 <div class="alert alert-success hide" id="successAlert"></div> 63 <div class="alert alert-error hide" id="failureAlert"></div> 64 <div class="form-actions"> 65 <input class="btn btn-primary" id="submitButton" type="submit" value="Add" data-loading-text="Saving .."> 66 <a class="btn btn-default" href="/dashboard">Cancel</a> 67 </div> 68 </form> 69 </div><!-- ./col-xs-9 --> 70 </div><!-- ./row --> 71 </div><!-- ./container --> 72 {{ end }} 73 74 {{ define "script" }} 75 <script> 76 document.forms[0].onsubmit = function(event) { 77 $("#successAlert").hide(); 78 $("#failureAlert").hide(); 79 $('#submitButton').button('loading') 80 81 var form = event.target 82 var formData = new FormData(form); 83 xhr = new XMLHttpRequest(); 84 xhr.open('POST', form.action); 85 xhr.onload = function() { 86 if (this.status == 200) { 87 var name = $("input[name=name]").val() 88 var owner = $("input[name=owner]").val() 89 window.location.pathname = "/bitbucket.org/"+owner+"/"+name 90 } else { 91 $("#failureAlert").text("Unable to setup the Repository"); 92 $("#failureAlert").show().removeClass("hide"); 93 $('#submitButton').button('reset') 94 }; 95 }; 96 xhr.send(formData); 97 return false; 98 } 99 </script> 100 {{ end }}