update PR based on the feedback

This commit is contained in:
Philipp Dorschner 2020-04-09 15:04:10 +02:00
parent 564fb8c320
commit aac860b118
1 changed files with 5 additions and 4 deletions

View File

@ -43,10 +43,10 @@ use Icinga\Data\Selectable;
<tr>
<th><?= $this->translate('Role Memberships'); ?></th>
<td>
<?php $roleObj = $userObj->getRoles(); ?>
<?php if (! empty($roleObj)): ?>
<?php $roles = $userObj->getRoles(); ?>
<?php if (! empty($roles)): ?>
<ul class="role-memberships">
<?php foreach($roleObj as $role): ?>
<?php foreach($roles as $role): ?>
<li>
<?php if ($this->allowedToEditRoles): ?>
<?= $this->qlink(
@ -54,7 +54,8 @@ use Icinga\Data\Selectable;
'role/edit',
['role' => $role->getName()],
['title' => sprintf($this->translate('Edit role %s'), $role->getName())]
) ?>
);
$role === end($roles) ? print '' : print ', '; ?>
<?php else: ?>
<?= $role->getName() ?>
<?php endif ?>