2014-06-04 21:25:38 +00:00
|
|
|
extends base
|
|
|
|
|
|
|
|
block title
|
|
|
|
| #{Repo.Name} · Config
|
|
|
|
|
|
|
|
block content
|
|
|
|
article.pure-g
|
|
|
|
header.pure-u-1
|
|
|
|
h1
|
|
|
|
span #{Repo.Owner}
|
|
|
|
span /
|
2014-06-07 20:14:16 +00:00
|
|
|
a[href="/"+Repo.Host+"/"+Repo.Owner+"/"+Repo.Name] #{Repo.Name}
|
2014-06-04 21:25:38 +00:00
|
|
|
span /
|
|
|
|
a[href="#"] settings
|
2014-06-07 20:14:16 +00:00
|
|
|
a.pure-button[href="/"+Repo.Host+"/"+Repo.Owner+"/"+Repo.Name]
|
2014-06-04 21:25:38 +00:00
|
|
|
i.fa.fa-dashboard
|
|
|
|
|
|
|
|
section.pure-u-1
|
2014-06-06 18:36:16 +00:00
|
|
|
form.pure-form.pure-form-stacked[action="/v1/repos/"+Repo.Host+"/"+Repo.Owner+"/"+Repo.Name]
|
2014-06-04 21:25:38 +00:00
|
|
|
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
|
2014-06-07 20:14:16 +00:00
|
|
|
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})
|
2014-06-04 21:25:38 +00:00
|
|
|
details
|
|
|
|
summary Private Variables
|
2014-06-06 18:36:16 +00:00
|
|
|
textarea[spellcheck="false"][placeholder="FOO: BAR"][name="params"] #{Repo.Params}
|
2014-06-04 21:25:38 +00:00
|
|
|
details
|
|
|
|
summary Public Key
|
|
|
|
textarea[spellcheck="false"][rows="5"] #{Repo.PublicKey}
|
|
|
|
|
|
|
|
div.pure-controls
|
2014-06-06 18:36:16 +00:00
|
|
|
button.pure-button.pure-button-primary[type="submit"] Save
|
2014-06-04 21:25:38 +00:00
|
|
|
button.pure-button.pure-button-secondary[type="reset"] Reset
|
2014-06-06 18:36:16 +00:00
|
|
|
|
|
|
|
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;
|
|
|
|
}
|