github.com/marinho/drone@v0.2.1-0.20140504195434-d3ba962e89a7/pkg/template/pages/repo_params.html (about) 1 {{ define "title" }}{{.Repo.Slug}} ยท Secure{{ 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="/{{.Repo.Slug}}">Commits</a></li> 9 <li class="active"><a href="/{{.Repo.Slug}}/settings">Settings</a></li> 10 </ul> <!-- ./nav --> 11 <h1> 12 <span>{{.Repo.Name}}</span> 13 <small>{{.Repo.Owner}}</small> 14 </h1> 15 </div><!-- ./container --> 16 </div><!-- ./subhead --> 17 18 19 <div class="container"> 20 <div class="row"> 21 <div class="col-xs-3"> 22 <ul class="nav nav-pills nav-stacked"> 23 <li><a href="/{{.Repo.Slug}}/settings">Repository</a></li> 24 <li class="active"><a href="/{{.Repo.Slug}}/params">Params</a></li> 25 <li><a href="/{{.Repo.Slug}}/keys">Key Pairs</a></li> 26 <li><a href="/{{.Repo.Slug}}/badges">Badges</a></li> 27 <li><a href="/{{.Repo.Slug}}/delete">Delete</a></li> 28 </ul> 29 </div><!-- ./col-xs-3 --> 30 31 <div class="col-xs-9" role="main"> 32 <div class="alert">Secure build configuration parameters</div> 33 <form method="POST" action="/{{.Repo.Slug}}?action=params"> 34 <label>Build parameters are injected in your drone.yml file at runtime.</label> 35 <div> 36 <textarea name="params" class="form-control" rows="5" placeholder="foo: bar" spellcheck="false">{{.Textarea}}</textarea> 37 </div> 38 <div class="alert alert-success hide" id="successAlert"></div> 39 <div class="alert alert-error hide" id="failureAlert"></div> 40 <div class="form-actions"> 41 <input class="btn btn-primary" id="submitButton" type="submit" value="Save" data-loading-text="Saving .."> 42 <a class="btn btn-default" href="/{{.Repo.Slug}}/params">Cancel</a> 43 </div> 44 </form> 45 </div><!-- ./col-xs-9 --> 46 </div><!-- ./row --> 47 </div><!-- ./container --> 48 {{ end }} 49 50 {{ define "script" }} 51 <script> 52 document.forms[0].onsubmit = function(event) { 53 $("#successAlert").hide(); 54 $("#failureAlert").hide(); 55 $('#submitButton').button('loading') 56 57 var form = event.target 58 var formData = new FormData(form); 59 xhr = new XMLHttpRequest(); 60 xhr.open('POST', form.action); 61 xhr.onload = function() { 62 if (this.status == 200) { 63 $("#successAlert").text("Successfully updated the secure data."); 64 $("#successAlert").show().removeClass("hide"); 65 $('#submitButton').button('reset') 66 } else { 67 $("#failureAlert").text("Failed to invite the secure data. Please try again"); 68 $("#failureAlert").show().removeClass("hide"); 69 $('#submitButton').button('reset') 70 }; 71 }; 72 xhr.send(formData); 73 return false; 74 } 75 </script> 76 {{ end }}