woodpecker/server/template/repo_conf.amber

80 lines
No EOL
2.6 KiB
Text

extends base
block title
| #{Repo.Name} · Config
block content
article.pure-g
header.pure-u-1
h1
span #{Repo.Owner}
span /
a[href="/"+Repo.Host+"/"+Repo.Owner+"/"+Repo.Name] #{Repo.Name}
span /
a[href="#"] settings
a.pure-button[href="/"+Repo.Host+"/"+Repo.Owner+"/"+Repo.Name]
i.fa.fa-dashboard
section.pure-u-1
form.pure-form.pure-form-stacked[action="/v1/repos/"+Repo.Host+"/"+Repo.Owner+"/"+Repo.Name]
fieldset
details[open]
summary Commit Hooks
div.pure-control-group
div.onoffswitch
input[type="checkbox"][name="post_commits"][checked=Repo.PostCommit].onoffswitch-checkbox#post_commits
label.onoffswitch-label[for="post_commits"]
div.onoffswitch-inner
div.onoffswitch-active
div.onoffswitch-switch ON
div.onoffswitch-inactive
div.onoffswitch-switch OFF
span Post Commit Hooks
div.pure-control-group
div.onoffswitch
input[type="checkbox"][name="pull_requests"][checked=Repo.PullRequest].onoffswitch-checkbox#pull_requests
label.onoffswitch-label[for="pull_requests"]
div.onoffswitch-inner
div.onoffswitch-active
div.onoffswitch-switch ON
div.onoffswitch-inactive
div.onoffswitch-switch OFF
span Pull Request Hooks
details
summary Badges
textarea[spellcheck="false"] [![Build Status](#{Scheme}://#{Host}/v1/badge/#{Repo.Host}/#{Repo.Owner}/#{Repo.Name}/status.svg)](#{Scheme}://#{Host}/#{Repo.Host}/#{Repo.Owner}/#{Repo.Name})
details
summary Private Variables
textarea[spellcheck="false"][placeholder="FOO: BAR"][name="params"] #{Repo.Params}
details
summary Public Key
textarea[spellcheck="false"][rows="5"] #{Repo.PublicKey}
div.pure-controls
button.pure-button.pure-button-primary[type="submit"] Save
button.pure-button.pure-button-secondary[type="reset"] Reset
block append scripts
script
document.getElementById("post_commits").checked = #{Repo.PostCommit};
document.getElementById("pull_requests").checked = #{Repo.PullRequest};
document.forms[0].onsubmit = function(event) {
event.preventDefault();
var form = event.target;
$.ajax({
url: form.action,
type: 'PUT',
contentType: 'application/json',
data: JSON.stringify({
post_commits: form.elements.post_commits.checked,
pull_requests: form.elements.pull_requests.checked,
params: form.elements.params.value
}),
dataType: 'json'
}).done(function() {
alert( "success" );
}).fail(function() {
alert( "error" );
});
return false;
}