mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-07-27 15:54:03 +02:00
UserController: Add links to add and delete users to the list action's view
refs #8826
This commit is contained in:
parent
539b824470
commit
fecf7a52b0
@ -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; ?>
|
||||||
@ -16,6 +21,9 @@
|
|||||||
if ($backend === null) {
|
if ($backend === null) {
|
||||||
echo $this->translate('No backend found which is able to list users') . '</div>';
|
echo $this->translate('No backend found which is able to list users') . '</div>';
|
||||||
return;
|
return;
|
||||||
|
} else {
|
||||||
|
$extensible = $backend instanceof Extensible;
|
||||||
|
$reducible = $backend instanceof Reducible;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (! isset($users)) {
|
if (! isset($users)) {
|
||||||
@ -36,6 +44,9 @@ if (count($users) === 0) {
|
|||||||
<th class="user-state"><?= $this->translate('State'); ?></th>
|
<th class="user-state"><?= $this->translate('State'); ?></th>
|
||||||
<th class="user-created"><?= $this->translate('Created at'); ?></th>
|
<th class="user-created"><?= $this->translate('Created at'); ?></th>
|
||||||
<th class="user-modified"><?= $this->translate('Last modified'); ?></th>
|
<th class="user-modified"><?= $this->translate('Last modified'); ?></th>
|
||||||
|
<?php if ($reducible): ?>
|
||||||
|
<th class="user-remove"><?= $this->translate('Remove'); ?></th>
|
||||||
|
<?php endif ?>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
@ -51,8 +62,31 @@ if (count($users) === 0) {
|
|||||||
<td class="user-modified">
|
<td class="user-modified">
|
||||||
<?= $user->last_modified === null ? $this->translate('Never') : date('d/m/Y g:i A', $user->last_modified); ?>
|
<?= $user->last_modified === null ? $this->translate('Never') : date('d/m/Y g:i A', $user->last_modified); ?>
|
||||||
</td>
|
</td>
|
||||||
|
<?php if ($reducible): ?>
|
||||||
|
<td class="user-remove">
|
||||||
|
<?= $this->qlink(
|
||||||
|
null,
|
||||||
|
'user/remove',
|
||||||
|
array(
|
||||||
|
'backend' => $backend->getName(),
|
||||||
|
'user' => $user->user_name
|
||||||
|
),
|
||||||
|
array(
|
||||||
|
'title' => sprintf($this->translate('Remove user %s'), $user->user_name),
|
||||||
|
'icon' => 'trash'
|
||||||
|
)
|
||||||
|
); ?>
|
||||||
|
</td>
|
||||||
|
<?php endif ?>
|
||||||
</tr>
|
</tr>
|
||||||
<?php endforeach ?>
|
<?php endforeach ?>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
|
<?php if ($extensible): ?>
|
||||||
|
<?= $this->qlink($this->translate('Add a new user'), 'user/add', array('backend' => $backend->getName()), array(
|
||||||
|
'icon' => 'plus',
|
||||||
|
'data-base-target' => '_next',
|
||||||
|
'class' => 'user-add'
|
||||||
|
)); ?>
|
||||||
|
<?php endif ?>
|
||||||
</div>
|
</div>
|
@ -205,7 +205,7 @@ table.benchmark {
|
|||||||
|
|
||||||
table.user-list {
|
table.user-list {
|
||||||
th {
|
th {
|
||||||
&.user-state {
|
&.user-state, &.user-remove {
|
||||||
width: 6%;
|
width: 6%;
|
||||||
padding-right: 0.5em;
|
padding-right: 0.5em;
|
||||||
text-align: right;
|
text-align: right;
|
||||||
@ -218,7 +218,7 @@ table.user-list {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
td.user-state, td.user-created, td.user-modified {
|
td.user-state, td.user-created, td.user-modified, td.user-remove {
|
||||||
text-align: right;
|
text-align: right;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user