group/list.phtml: Fix coding style, link targets, css, etc

refs #10367
This commit is contained in:
Johannes Meyer 2015-10-15 16:14:19 +02:00
parent 0ee73f2560
commit 1144c86936
3 changed files with 68 additions and 93 deletions

View File

@ -44,7 +44,7 @@ class GroupController extends AuthBackendController
'backend', 'backend',
array( array(
'autosubmit' => true, 'autosubmit' => true,
'label' => $this->translate('Usergroup Backend'), 'label' => $this->translate('User Group Backend'),
'multiOptions' => array_combine($backendNames, $backendNames), 'multiOptions' => array_combine($backendNames, $backendNames),
'value' => $this->params->get('backend') 'value' => $this->params->get('backend')
) )
@ -66,7 +66,7 @@ class GroupController extends AuthBackendController
$this->setupLimitControl(); $this->setupLimitControl();
$this->setupSortControl( $this->setupSortControl(
array( array(
'group_name' => $this->translate('Group'), 'group_name' => $this->translate('User Group'),
'created_at' => $this->translate('Created at'), 'created_at' => $this->translate('Created at'),
'last_modified' => $this->translate('Last modified') 'last_modified' => $this->translate('Last modified')
), ),

View File

@ -4,30 +4,24 @@ use Icinga\Data\Extensible;
use Icinga\Data\Reducible; use Icinga\Data\Reducible;
if (! $this->compact): ?> if (! $this->compact): ?>
<div class="controls"> <div class="controls separated dont-print">
<?= $this->tabs; ?> <?= $tabs; ?>
<div class="grid dont-print"> <div class="grid">
<div class="col-1-3 text-left">
<?= $this->limiter ?> <?= $this->limiter ?>
</div>
<div class="col-1-3">
<?= $this->paginator ?> <?= $this->paginator ?>
</div>
<div class="col-1-3 text-right">
<?= $this->sortBox ?> <?= $this->sortBox ?>
</div> </div>
</div>
<div> <div>
<?= $this->backendSelection; ?> <?= $this->backendSelection; ?>
<?= $this->filterEditor; ?> <?= $this->filterEditor; ?>
</div> </div>
</div> </div>
<?php endif ?> <?php endif ?>
<div class="content groups"> <div class="content">
<?php <?php
if (! isset($backend)) { if (! isset($backend)) {
echo $this->translate('No backend found which is able to list groups') . '</div>'; echo $this->translate('No backend found which is able to list user groups') . '</div>';
return; return;
} else { } else {
$extensible = $this->hasPermission('config/authentication/groups/add') && $backend instanceof Extensible; $extensible = $this->hasPermission('config/authentication/groups/add') && $backend instanceof Extensible;
@ -37,44 +31,52 @@ if (! isset($backend)) {
<?php if ($extensible): ?> <?php if ($extensible): ?>
<?= $this->qlink( <?= $this->qlink(
$this->translate('Add a New User Group') , $this->translate('Add a New User Group'),
'group/add', 'group/add',
array('backend' => $backend->getName()), array('backend' => $backend->getName()),
array( array(
'class' => 'button-link', 'class' => 'button-link',
'data-base-target' => '_next', 'data-base-target' => '_next',
'icon' => 'plus', 'icon' => 'plus'
'title' => $this->translate('Create a new user group')
) )
) ?> ) ?>
<?php endif ?> <?php endif ?>
<?php <?php if (! $groups->hasResult()): ?>
// @TODO(el): Remove $firstRow stuff <p><?= $this->translate('No user groups found matching the filter'); ?></p>
$firstRow = true; </div>
foreach ($groups as $group): ?> <?php endif ?>
<?php if ($firstRow): ?>
<?php $firstRow = false; ?> <table data-base-target="_next" class="action-table listing-table">
<table data-base-target="_next" class="action-table listing-table">
<thead> <thead>
<tr> <tr>
<th class="group-name"><?= $this->translate('Group'); ?></th> <th><?= $this->translate('User Group'); ?></th>
<?php if ($reducible): ?> <?php if ($reducible): ?>
<th class="group-remove"><?= $this->translate('Remove'); ?></th> <th><?= $this->translate('Remove'); ?></th>
<?php endif ?> <?php endif ?>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
<?php endif ?> <?php foreach ($groups as $group): ?>
<tr> <tr>
<td class="group-name"><?= $this->qlink($group->group_name, 'group/show', array( <td>
<?= $this->qlink(
$group->group_name,
'group/show',
array(
'backend' => $backend->getName(), 'backend' => $backend->getName(),
'group' => $group->group_name 'group' => $group->group_name
), array( ),
'title' => sprintf($this->translate('Show detailed information for group %s'), $group->group_name) array(
)); ?></td> 'title' => sprintf(
$this->translate('Show detailed information for user group %s'),
$group->group_name
)
)
); ?>
</td>
<?php if ($reducible): ?> <?php if ($reducible): ?>
<td class="group-remove"> <td class="icon-col">
<?= $this->qlink( <?= $this->qlink(
null, null,
'group/remove', 'group/remove',
@ -83,18 +85,14 @@ foreach ($groups as $group): ?>
'group' => $group->group_name 'group' => $group->group_name
), ),
array( array(
'title' => sprintf($this->translate('Remove group %s'), $group->group_name), 'title' => sprintf($this->translate('Remove user group %s'), $group->group_name),
'icon' => 'trash' 'icon' => 'trash'
) )
); ?> ); ?>
</td> </td>
<?php endif ?> <?php endif ?>
</tr> </tr>
<?php endforeach ?> <?php endforeach ?>
<?php if ($groups->hasResult()): ?>
</tbody> </tbody>
</table> </table>
<?php else: ?>
<p><?= $this->translate('No groups found matching the filter'); ?></p>
<?php endif ?>
</div> </div>

View File

@ -233,29 +233,6 @@ div.content.users {
} }
} }
div.content.groups {
table.group-list {
th.group-remove {
width: 8em;
padding-right: 0.5em;
text-align: right;
}
td.group-remove {
text-align: right;
}
}
p {
margin-top: 0;
}
a.group-add {
display: block;
margin-top: 1em;
}
}
form.backend-selection { form.backend-selection {
float: right; float: right;