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 ?> <?= $this->paginator ?>
<?= $this->sortBox ?>
</div> </div>
<div class="col-1-3"> <div>
<?= $this->paginator ?> <?= $this->backendSelection; ?>
<?= $this->filterEditor; ?>
</div> </div>
<div class="col-1-3 text-right">
<?= $this->sortBox ?>
</div>
</div>
<div>
<?= $this->backendSelection; ?>
<?= $this->filterEditor; ?>
</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,64 +31,68 @@ 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;
foreach ($groups as $group): ?>
<?php if ($firstRow): ?>
<?php $firstRow = false; ?>
<table data-base-target="_next" class="action-table listing-table">
<thead>
<tr>
<th class="group-name"><?= $this->translate('Group'); ?></th>
<?php if ($reducible): ?>
<th class="group-remove"><?= $this->translate('Remove'); ?></th>
<?php endif ?>
</tr>
</thead>
<tbody>
<?php endif ?>
<tr>
<td class="group-name"><?= $this->qlink($group->group_name, 'group/show', array(
'backend' => $backend->getName(),
'group' => $group->group_name
), array(
'title' => sprintf($this->translate('Show detailed information for group %s'), $group->group_name)
)); ?></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>
<?php endforeach ?>
<?php if ($groups->hasResult()): ?>
</tbody>
</table>
<?php else: ?>
<p><?= $this->translate('No groups found matching the filter'); ?></p>
<?php endif ?>
</div> </div>
<?php endif ?>
<table data-base-target="_next" class="action-table listing-table">
<thead>
<tr>
<th><?= $this->translate('User Group'); ?></th>
<?php if ($reducible): ?>
<th><?= $this->translate('Remove'); ?></th>
<?php endif ?>
</tr>
</thead>
<tbody>
<?php foreach ($groups as $group): ?>
<tr>
<td>
<?= $this->qlink(
$group->group_name,
'group/show',
array(
'backend' => $backend->getName(),
'group' => $group->group_name
),
array(
'title' => sprintf(
$this->translate('Show detailed information for user group %s'),
$group->group_name
)
)
); ?>
</td>
<?php if ($reducible): ?>
<td class="icon-col">
<?= $this->qlink(
null,
'group/remove',
array(
'backend' => $backend->getName(),
'group' => $group->group_name
),
array(
'title' => sprintf($this->translate('Remove user group %s'), $group->group_name),
'icon' => 'trash'
)
); ?>
</td>
<?php endif ?>
</tr>
<?php endforeach ?>
</tbody>
</table>
</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;