mirror of
https://github.com/Icinga/icingaweb2-module-businessprocess.git
synced 2026-05-28 04:34:08 -04:00
TileRenderer: Allow to reorder tiles by using drag&drop
This commit is contained in:
parent
f4298034b9
commit
8c2f0e30bb
2 changed files with 11 additions and 2 deletions
|
|
@ -3,6 +3,7 @@
|
|||
namespace Icinga\Module\Businessprocess\Renderer;
|
||||
|
||||
use Icinga\Module\Businessprocess\Renderer\TileRenderer\NodeTile;
|
||||
use Icinga\Module\Businessprocess\Web\Form\CsrfToken;
|
||||
use ipl\Html\Html;
|
||||
|
||||
class TileRenderer extends Renderer
|
||||
|
|
@ -16,8 +17,13 @@ class TileRenderer extends Renderer
|
|||
$nodesDiv = Html::tag(
|
||||
'div',
|
||||
[
|
||||
'class' => ['tiles', $this->howMany()],
|
||||
'data-base-target' => '_next'
|
||||
'class' => ['sortable', 'tiles', $this->howMany()],
|
||||
'data-base-target' => '_next',
|
||||
'data-sortable-disabled' => $this->isLocked(),
|
||||
'data-sortable-data-id-attr' => 'id',
|
||||
'data-sortable-filter' => '.addnew',
|
||||
'data-csrf-token' => CsrfToken::generate(),
|
||||
'data-action-url' => $this->getUrl()->getAbsoluteUrl()
|
||||
]
|
||||
);
|
||||
|
||||
|
|
|
|||
|
|
@ -73,6 +73,9 @@ class NodeTile extends BaseHtmlElement
|
|||
$attributes = $this->getAttributes();
|
||||
$attributes->add('class', $renderer->getNodeClasses($node));
|
||||
$attributes->add('id', 'bp-' . (string) $node);
|
||||
if (! $renderer->isLocked()) {
|
||||
$attributes->add('data-node-name', (string) $node);
|
||||
}
|
||||
|
||||
$this->addActions();
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue