mirror of
https://github.com/Icinga/icingaweb2-module-businessprocess.git
synced 2026-05-28 04:34:08 -04:00
TreeRenderer: Render add button as action link in the top right
This commit is contained in:
parent
36dd4e0296
commit
48ba2a7bba
2 changed files with 11 additions and 19 deletions
|
|
@ -181,14 +181,6 @@ class TreeRenderer extends Renderer
|
|||
}
|
||||
}
|
||||
|
||||
if (! $this->isLocked() && $node instanceof BpNode && $bp->getMetadata()->canModify()) {
|
||||
$tbody->add(Html::tag(
|
||||
'li',
|
||||
null,
|
||||
$this->renderAddNewNode($node)
|
||||
));
|
||||
}
|
||||
|
||||
return $table;
|
||||
}
|
||||
|
||||
|
|
@ -231,7 +223,7 @@ class TreeRenderer extends Renderer
|
|||
{
|
||||
if ($node instanceof BpNode) {
|
||||
if ($bp->getMetadata()->canModify()) {
|
||||
return $this->createEditAction($bp, $node);
|
||||
return [$this->createEditAction($bp, $node), $this->renderAddNewNode($node)];
|
||||
} else {
|
||||
return '';
|
||||
}
|
||||
|
|
@ -290,16 +282,12 @@ class TreeRenderer extends Renderer
|
|||
|
||||
protected function renderAddNewNode($parent)
|
||||
{
|
||||
return Html::tag(
|
||||
'a',
|
||||
[
|
||||
'href' => $this->getUrl()
|
||||
->with('action', 'add')
|
||||
->with('node', $parent->getName()),
|
||||
'title' => mt('businessprocess', 'Add a new business process node'),
|
||||
'class' => 'addnew icon-plus'
|
||||
],
|
||||
mt('businessprocess', 'Add')
|
||||
return $this->actionIcon(
|
||||
'plus',
|
||||
$this->getUrl()
|
||||
->with('action', 'add')
|
||||
->with('node', $parent->getName()),
|
||||
mt('businessprocess', 'Add a new business process node')
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -54,6 +54,10 @@ ul.tree {
|
|||
border: .2em dashed @gray-light;
|
||||
border-left-width: 0;
|
||||
}
|
||||
|
||||
a > div {
|
||||
display: inline-block;
|
||||
}
|
||||
}
|
||||
|
||||
ul {
|
||||
|
|
|
|||
Loading…
Reference in a new issue