Removed Github configuration from ProjectController / ProjectForm and added it to a new settings area.
This commit is contained in:
parent
cc86e85adb
commit
2a47b08fec
10 changed files with 332 additions and 88 deletions
|
|
@ -7,6 +7,14 @@ body
|
|||
padding-top: 70px;
|
||||
}
|
||||
|
||||
strong, th, .control-label {
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
.btn, .dropdown-menu>li>a, .controls, .controls input, .controls label {
|
||||
font-weight: 300;
|
||||
}
|
||||
|
||||
#content
|
||||
{
|
||||
-border: 10px solid #369;
|
||||
|
|
@ -61,6 +69,11 @@ td .label {
|
|||
padding: 0;
|
||||
}
|
||||
|
||||
h2 {
|
||||
color: #246;
|
||||
font-size: 1.8em;
|
||||
}
|
||||
|
||||
.icon-build-ok
|
||||
{
|
||||
background: url('../img/icon-build-ok.png') no-repeat top left;
|
||||
|
|
@ -81,13 +94,6 @@ td .label {
|
|||
background: url('../img/icon-build-running.png') no-repeat top left;
|
||||
}
|
||||
|
||||
h3
|
||||
{
|
||||
border-bottom: 1px solid #f0f0f0;
|
||||
margin-top: 0;
|
||||
padding-top: 0;
|
||||
}
|
||||
|
||||
.navbar-brand {
|
||||
padding: 10px 15px;
|
||||
}
|
||||
|
|
@ -102,7 +108,9 @@ h3
|
|||
border-bottom: 1px solid #eee;
|
||||
cursor: move;
|
||||
font-size: 1.2em;
|
||||
padding: 8px;
|
||||
margin: 0;
|
||||
margin-bottom: 20px;
|
||||
padding: 8px 0;
|
||||
}
|
||||
|
||||
.box .box-content {
|
||||
|
|
|
|||
|
|
@ -18,6 +18,8 @@ function confirmDelete(url)
|
|||
*/
|
||||
function setupProjectForm()
|
||||
{
|
||||
$('.github-container').hide();
|
||||
|
||||
$('#element-reference').change(function()
|
||||
{
|
||||
var el = $(this);
|
||||
|
|
@ -41,18 +43,26 @@ function setupProjectForm()
|
|||
|
||||
$('#element-type').change(function()
|
||||
{
|
||||
if(!window.github_app_id || $(this).val() != 'github' || window.github_token) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Show sign in with Github button.
|
||||
var el = $('#element-reference');
|
||||
var rtn = window.return_url;
|
||||
var url = 'https://github.com/login/oauth/authorize?client_id=' + window.github_app_id + '&scope=repo&redirect_uri=' + rtn;
|
||||
var btn = $('<a>').addClass('btn btn-inverse').text('Sign in with Github').attr('href', url);
|
||||
if ($(this).val() == 'github') {
|
||||
$('#loading').show();
|
||||
|
||||
el.after(btn);
|
||||
el.remove();
|
||||
$.getJSON(window.PHPCI_URL + 'project/github-repositories', function (data) {
|
||||
$('#loading').hide();
|
||||
|
||||
if (data.repos) {
|
||||
$('#element-github').empty();
|
||||
|
||||
for (var i in data.repos) {
|
||||
var name = data.repos[i];
|
||||
$('#element-github').append($('<option></option>').text(name).val(name));
|
||||
}
|
||||
|
||||
$('.github-container').slideDown();
|
||||
}
|
||||
});
|
||||
} else {
|
||||
$('.github-container').slideUp();
|
||||
}
|
||||
});
|
||||
|
||||
$('#element-github').change(function()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue