github.com/marinho/drone@v0.2.1-0.20140504195434-d3ba962e89a7/pkg/template/pages/repo_settings.html (about) 1 {{ define "title" }}{{.Repo.Slug}} ยท Settings{{ end }} 2 3 {{ define "content" }} 4 <div class="subhead"> 5 <div class="container"> 6 <ul class="nav nav-tabs pull-right"> 7 <li><a href="/{{.Repo.Slug}}">Commits</a></li> 8 <li class="active"><a href="/{{.Repo.Slug}}/settings">Settings</a></li> 9 </ul> <!-- ./nav --> 10 <h1> 11 <span>{{.Repo.Name}}</span> 12 <small>{{.Repo.Owner}}</small> 13 </h1> 14 </div><!-- ./container --> 15 </div><!-- ./subhead --> 16 17 18 <div class="container"> 19 <div class="row"> 20 21 <div class="col-xs-3"> 22 <ul class="nav nav-pills nav-stacked"> 23 <li class="active"><a href="/{{.Repo.Slug}}/settings">Repository</a></li> 24 <li><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">Manage your repository settings.</div> 33 <form method="POST" action="/{{.Repo.Slug}}" role="form"> 34 <div class="checkbox form-group"> 35 <label> 36 <input class="" type="checkbox" name="Disabled" {{ if not .Repo.Disabled }}checked="True" {{ end }}/> 37 Enable Build Hooks 38 </label> 39 </div> 40 <div class="checkbox form-group"> 41 <label> 42 <input class="" type="checkbox" name="DisabledPullRequest" {{ if not .Repo.DisabledPullRequest }}checked="True" {{ end }}/> 43 Enable Pull Hooks 44 </label> 45 </div> 46 <div class="checkbox form-group"> 47 <label> 48 <input class="" type="checkbox" name="Private" {{ if .Repo.Private }}checked="True" {{ end }}/> 49 Private 50 </label> 51 </div> 52 {{ if .User.Admin }} 53 <div class="alert alert-min">Admin-only settings.</div> 54 <div class="checkbox form-group"> 55 <label> 56 <input class="" type="checkbox" name="Privileged" {{ if .Repo.Privileged }}checked="True" {{ end }}/> 57 Enable Privileged Builds 58 </label> 59 </div> 60 {{ end }} 61 <div class="alert alert-min">Choose the account owner.</div> 62 <div> 63 <ul class="account-radio-group"> 64 <li> 65 <input type="radio" name="Owner" {{ if ne .Repo.UserID 0 }}checked="True"{{ end }} value=""> 66 <img src="{{ .User.Image }}"> 67 <span>Me</span> 68 </li> 69 {{ $teamID := .Repo.TeamID}} 70 {{ range .Teams }} 71 <li> 72 <input type="radio" name="Owner" value="{{ .Slug }}" {{ if eq $teamID .ID }}checked="True"{{ end }} /> 73 <img src="{{ .Image }}"> 74 <span>{{ .Name }}</span> 75 </li> 76 {{ end }} 77 </ul> 78 </div> 79 <div class="alert alert-success hide" id="successAlert"></div> 80 <div class="alert alert-error hide" id="failureAlert"></div> 81 <div class="form-actions"> 82 <input class="btn btn-primary" id="submitButton" type="submit" value="Save" data-loading-text="Saving .."> 83 <a class="btn btn-default" href="/{{ .Repo.Slug }}/settings">Cancel</a> 84 </div> 85 </form> 86 </div><!-- ./col-xs-9 --> 87 </div><!-- ./row --> 88 89 </div><!-- ./container --> 90 {{ end }} 91 92 {{ define "script" }} 93 <script> 94 document.forms[0].onsubmit = function(event) { 95 $("#successAlert").hide(); 96 $("#failureAlert").hide(); 97 $('#submitButton').button('loading') 98 99 var form = event.target 100 var formData = new FormData(form); 101 xhr = new XMLHttpRequest(); 102 xhr.open('POST', form.action); 103 xhr.onload = function() { 104 if (this.status == 200) { 105 $("#successAlert").text("Successfully updated the repository settings."); 106 $("#successAlert").show().removeClass("hide"); 107 $('#submitButton').button('reset') 108 } else { 109 $("#failureAlert").text("Failed to invite the repository settings. Please try again"); 110 $("#failureAlert").show().removeClass("hide"); 111 $('#submitButton').button('reset') 112 }; 113 }; 114 xhr.send(formData); 115 return false; 116 } 117 </script> 118 {{ end }}