display details of actual deployments

This commit is contained in:
Frédéric Péters 2016-06-22 20:23:46 +02:00
parent b786ec1066
commit 34114942b7
2 changed files with 43 additions and 0 deletions

27
javascripts/theme.js Normal file
View File

@ -0,0 +1,27 @@
$(function() {
if ($('.administration').length == 0) {
/* fake access control */
return;
}
if ($('body.controller-issues.action-show').length == 0) {
return;
}
var issue_no = $('a.atom').attr('href').split('/')[2].split('.')[0];
$.ajax({
url: 'https://scrutiny.entrouvert.org/projects/api/issues/' + issue_no + '/',
async: true,
dataType: 'jsonp',
crossDomain: true,
success: function(data) {
if (data.platforms) {
$('<h3>Déploiements</h3><ul id="deployed"></ul>').appendTo('#sidebar');
var platforms = Object.keys(data.platforms);
platforms.sort();
platforms.forEach(function(val) {
var status = data.platforms[val];
$('<li class="' + status.status + '">' + val + ': ' + status.version + '</li>').appendTo($('#deployed'));
});
}
}
});
});

View File

@ -273,3 +273,19 @@ table.list.issues tr.status-3 td.id,
table.list.issues tr.status-4 td.id {
text-decoration: line-through;
}
ul#deployed {
line-height: 150%;
}
ul#deployed li.nok {
color: #aaa;
}
ul#deployed li.ok::before {
content: "✔ ";
}
ul#deployed li.nok::before {
content: "✘ ";
}