Added collapse for boxes

This commit is contained in:
Dmitry Khomutov 2017-04-09 08:44:30 +07:00
parent 4f58316e12
commit f49d2b14bc
No known key found for this signature in database
GPG key ID: 7EB36C9576F9ECB9
8 changed files with 30 additions and 16 deletions

View file

@ -5,7 +5,6 @@ var codeceptionPlugin = ActiveBuild.UiPlugin.extend({
lastData: null,
lastMeta: null,
displayOnUpdate: false,
box: true,
rendered: false,
register: function() {

View file

@ -4,7 +4,6 @@ var phpspecPlugin = ActiveBuild.UiPlugin.extend({
title: Lang.get('phpspec'),
lastData: null,
displayOnUpdate: false,
box: true,
rendered: false,
register: function() {

View file

@ -3,7 +3,6 @@ var phptalPlugin = ActiveBuild.UiPlugin.extend({
css: 'col-xs-12',
title: 'PHPTAL Lint',
lastData: null,
box: true,
rendered: false,
register: function() {

View file

@ -4,7 +4,6 @@ var phpunitPlugin = ActiveBuild.UiPlugin.extend({
title: Lang.get('phpunit'),
lastData: null,
displayOnUpdate: false,
box: true,
rendered: false,
statusMap: {
success : 'ok',

View file

@ -2,7 +2,6 @@ var SummaryPlugin = ActiveBuild.UiPlugin.extend({
id: 'build-summary',
css: 'col-xs-12',
title: Lang.get('build-summary'),
box: true,
statusLabels: [Lang.get('pending'), Lang.get('running'), Lang.get('success'), Lang.get('failed'), Lang.get('failed_allowed')],
statusClasses: ['info', 'warning', 'success', 'danger', 'danger'],

View file

@ -146,28 +146,25 @@ var Build = Class.extend({
}
}
$('#plugins').sortable({
handle: '.box-title',
connectWith: '#plugins',
update: self.storePluginOrder
});
$(window).trigger({type: 'build-updated', queryData: self.buildData});
},
renderPlugin: function(plugin) {
var output = plugin.render();
if (!plugin.box) {
output = $('<div class="box-body"></div>').append(output);
}
output = $('<div class="box-body"></div>').append(output);
var container = $('<div></div>').addClass('ui-plugin ' + plugin.css).attr('id', plugin.id);
var content = $('<div></div>').append(output);
content.addClass('box');
if (plugin.title) {
content.prepend('<div class="box-header"><h3 class="box-title">'+plugin.title+'</h3></div>');
content.prepend(
'<div class="box-header"><h3 class="box-title">'+plugin.title+'</h3>'+
'<div class="box-tools pull-right">'+
'<button type="button" class="btn btn-box-tool" data-widget="collapse" data-toggle="tooltip" title="Collapse">'+
'<i class="fa fa-minus"></i></button></div></div>'
);
}
container.append(content);

View file

@ -14,6 +14,11 @@ use PHPCensor\Model\Build;
<div class="box">
<div class="box-header">
<h3 class="box-title"><?php print $group['title']; ?></h3>
<div class="box-tools pull-right">
<button type="button" class="btn btn-box-tool" data-widget="collapse" data-toggle="tooltip" title="Collapse">
<i class="fa fa-minus"></i>
</button>
</div>
</div>
<div class="box-body">

View file

@ -198,6 +198,11 @@
<div class="box">
<div class="box-header">
<h4 class="box-title"><?= Lang::get('public_status_title'); ?></h4>
<div class="box-tools pull-right">
<button type="button" class="btn btn-box-tool" data-widget="collapse" data-toggle="tooltip" title="Collapse">
<i class="fa fa-minus"></i>
</button>
</div>
</div>
<div class="box-body">
@ -220,6 +225,11 @@
<div class="box">
<div class="box-header">
<h4 class="box-title"><?php Lang::out('webhooks'); ?></h4>
<div class="box-tools pull-right">
<button type="button" class="btn btn-box-tool" data-widget="collapse" data-toggle="tooltip" title="Collapse">
<i class="fa fa-minus"></i>
</button>
</div>
</div>
<div class="box-body">
@ -250,7 +260,14 @@
<?php if ($project->getSshPublicKey()): ?>
<div class="box">
<div class="box-header"><h3 class="box-title"><?php Lang::out('public_key'); ?></h3></div>
<div class="box-header">
<h3 class="box-title"><?php Lang::out('public_key'); ?></h3>
<div class="box-tools pull-right">
<button type="button" class="btn btn-box-tool" data-widget="collapse" data-toggle="tooltip" title="Collapse">
<i class="fa fa-minus"></i>
</button>
</div>
</div>
<div class="box-body" style="word-break: break-all;"><?php print $project->getSshPublicKey(); ?></div>
</div>
<?php endif; ?>