diff --git a/javascripts/theme.js b/javascripts/theme.js index 69360c3..75a1dae 100644 --- a/javascripts/theme.js +++ b/javascripts/theme.js @@ -154,6 +154,34 @@ $(function() { } }); + if ($('.controller-issues.action-show a.overview').length) { + var project_name = $('a.overview').attr('href').split('/')[2]; + var issue_no = $('.icon-edit[accesskey=e]').attr('href').split('/')[2]; + $.ajax({ + url: 'https://jenkins2.entrouvert.org/job/' + project_name + '-wip/api/json', + async: true, + dataType: 'json', + crossDomain: true, + success: function(data) { + $(data.jobs).each(function(idx, job) { + if (job.name.indexOf('wip%2F' + issue_no) == 0) { + $.ajax({ + url: job.url + 'lastBuild/api/json', + async: true, + dataType: 'json', + crossDomain: true, + success: function(data) { + var date = new Date(data.timestamp); + var $jenkins_link = $('
Jenkins: ' + data.fullDisplayName + ': ' + data.result + ' (' + date.toLocaleString() + ')
'); + $jenkins_link.appendTo($('#history')); + } + }); + } + }); + } + }); + } + if ($('.administration').length == 0) { /* fake access control */ return; diff --git a/stylesheets/application.css b/stylesheets/application.css index 6654f53..3f58432 100644 --- a/stylesheets/application.css +++ b/stylesheets/application.css @@ -361,3 +361,15 @@ div.wiki hr { margin: 2em auto; width: 90%; } + +div.jenkins { + margin: 1em 1em 1em 1.6em; + border: 2px solid #e2e2e2; + padding: 1ex; + background: #fafafa; +} + +div.jenkins-FAILURE { + border-color: red; + background: #ff9b9b; +}