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