GroupController: Add links to add and remove groups to the list action's view
refs #8826
This commit is contained in:
parent
66611d4887
commit
4a48997f47
|
@ -1,4 +1,9 @@
|
||||||
<?php if (! $this->compact): ?>
|
<?php
|
||||||
|
|
||||||
|
use Icinga\Data\Extensible;
|
||||||
|
use Icinga\Data\Reducible;
|
||||||
|
|
||||||
|
if (! $this->compact): ?>
|
||||||
<div class="controls">
|
<div class="controls">
|
||||||
<?= $this->tabs; ?>
|
<?= $this->tabs; ?>
|
||||||
<?= $this->sortBox; ?>
|
<?= $this->sortBox; ?>
|
||||||
|
@ -10,12 +15,15 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<?php endif ?>
|
<?php endif ?>
|
||||||
<div class="content">
|
<div class="content groups">
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
if ($backend === null) {
|
if ($backend === null) {
|
||||||
echo $this->translate('No backend found which is able to list groups') . '</div>';
|
echo $this->translate('No backend found which is able to list groups') . '</div>';
|
||||||
return;
|
return;
|
||||||
|
} else {
|
||||||
|
$extensible = $backend instanceof Extensible;
|
||||||
|
$reducible = $backend instanceof Reducible;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (! isset($groups)) {
|
if (! isset($groups)) {
|
||||||
|
@ -23,12 +31,7 @@ if (! isset($groups)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (count($groups) === 0) {
|
if (count($groups) > 0): ?>
|
||||||
echo $this->translate('No groups found matching the filter') . '</div>';
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
?>
|
|
||||||
|
|
||||||
<table data-base-target="_next" class="action group-list">
|
<table data-base-target="_next" class="action group-list">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
|
@ -36,6 +39,9 @@ if (count($groups) === 0) {
|
||||||
<th class="group-parent"><?= $this->translate('Parent'); ?></th>
|
<th class="group-parent"><?= $this->translate('Parent'); ?></th>
|
||||||
<th class="group-created"><?= $this->translate('Created at'); ?></th>
|
<th class="group-created"><?= $this->translate('Created at'); ?></th>
|
||||||
<th class="group-modified"><?= $this->translate('Last modified'); ?></th>
|
<th class="group-modified"><?= $this->translate('Last modified'); ?></th>
|
||||||
|
<?php if ($reducible): ?>
|
||||||
|
<th class="group-remove"><?= $this->translate('Remove'); ?></th>
|
||||||
|
<?php endif ?>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
|
@ -51,8 +57,34 @@ if (count($groups) === 0) {
|
||||||
<td class="group-modified">
|
<td class="group-modified">
|
||||||
<?= $group->last_modified === null ? $this->translate('Never') : date('d/m/Y g:i A', $group->last_modified); ?>
|
<?= $group->last_modified === null ? $this->translate('Never') : date('d/m/Y g:i A', $group->last_modified); ?>
|
||||||
</td>
|
</td>
|
||||||
|
<?php if ($reducible): ?>
|
||||||
|
<td class="group-remove">
|
||||||
|
<?= $this->qlink(
|
||||||
|
null,
|
||||||
|
'group/remove',
|
||||||
|
array(
|
||||||
|
'backend' => $backend->getName(),
|
||||||
|
'group' => $group->group_name
|
||||||
|
),
|
||||||
|
array(
|
||||||
|
'title' => sprintf($this->translate('Remove group %s'), $group->group_name),
|
||||||
|
'icon' => 'trash'
|
||||||
|
)
|
||||||
|
); ?>
|
||||||
|
</td>
|
||||||
|
<?php endif ?>
|
||||||
</tr>
|
</tr>
|
||||||
<?php endforeach ?>
|
<?php endforeach ?>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
|
<?php else: ?>
|
||||||
|
<p><?= $this->translate('No groups found matching the filter'); ?></p>
|
||||||
|
<?php endif ?>
|
||||||
|
<?php if ($extensible): ?>
|
||||||
|
<?= $this->qlink($this->translate('Add a new group'), 'group/add', array('backend' => $backend->getName()), array(
|
||||||
|
'icon' => 'plus',
|
||||||
|
'data-base-target' => '_next',
|
||||||
|
'class' => 'group-add'
|
||||||
|
)); ?>
|
||||||
|
<?php endif ?>
|
||||||
</div>
|
</div>
|
|
@ -223,23 +223,29 @@ table.user-list {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
table.group-list {
|
div.content.groups {
|
||||||
th {
|
table.group-list {
|
||||||
&.group-parent {
|
th {
|
||||||
width: 6%;
|
&.group-parent, &.group-remove {
|
||||||
padding-right: 0.5em;
|
width: 6%;
|
||||||
text-align: right;
|
padding-right: 0.5em;
|
||||||
|
text-align: right;
|
||||||
|
}
|
||||||
|
|
||||||
|
&.group-created, &.group-modified {
|
||||||
|
width: 12%;
|
||||||
|
padding-right: 0.5em;
|
||||||
|
text-align: right;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
&.group-created, &.group-modified {
|
td.group-parent, td.group-created, td.group-modified, td.group-remove {
|
||||||
width: 12%;
|
|
||||||
padding-right: 0.5em;
|
|
||||||
text-align: right;
|
text-align: right;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
td.group-parent, td.group-created, td.group-modified {
|
p {
|
||||||
text-align: right;
|
margin-top: 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue