UserController: Fix design for showing a user

This commit is contained in:
Johannes Meyer 2015-06-25 11:27:28 +02:00
parent e3f13c8a44
commit af7426451a
2 changed files with 57 additions and 44 deletions

View File

@ -23,38 +23,37 @@ if ($this->hasPermission('config/authentication/users/edit') && $backend instanc
?> ?>
<div class="controls"> <div class="controls">
<?php if (! $this->compact): ?> <?php if (! $this->compact): ?>
<?= $tabs ?> <?= $tabs; ?>
<?php endif ?> <?php endif ?>
<h1><?= $this->escape($user->user_name); ?><span class="pull-right"><?= $editLink; ?></span></h1>
<h1><?= $this->escape($user->user_name); ?><span class="pull-right"><?= $editLink ?></span></h1> <table class="avp user-header">
<tr>
<th><?= $this->translate('State'); ?></th>
<td><?= $user->is_active === null ? '-' : ($user->is_active ? $this->translate('Active') : $this->translate('Inactive')); ?></td>
</tr>
<tr>
<th><?= $this->translate('Created at'); ?></th>
<td><?= $user->created_at === null ? '-' : $this->formatDateTime($user->created_at); ?></td>
</tr>
<tr>
<th><?= $this->translate('Last modified'); ?></th>
<td><?= $user->last_modified === null ? '-' : $this->formatDateTime($user->last_modified); ?></td>
</tr>
</table>
<h2><?= $this->translate('Group Memberships'); ?></h2>
<?php if (! $this->compact): ?>
<?= $this->sortBox ?>
<?php endif ?>
<?= $this->limiter ?>
<?= $this->paginator ?>
<?php if (! $this->compact): ?>
<?= $this->filterEditor ?>
<?php endif ?>
</div> </div>
<div class="content"> <div class="content memberships">
<table class="avp">
<tr>
<th><?= $this->translate('State'); ?>:</th>
<td><?= $user->is_active === null ? '-' : ($user->is_active ? $this->translate('Active') : $this->translate('Inactive')); ?></td>
</tr>
<tr>
<th><?= $this->translate('Created at'); ?>:</th>
<td><?= $user->created_at === null ? '-' : $this->formatDateTime($user->created_at); ?></td>
</tr>
<tr>
<th><?= $this->translate('Last modified'); ?>:</th>
<td><?= $user->last_modified === null ? '-' : $this->formatDateTime($user->last_modified); ?></td>
</tr>
</table>
<h3><?= $this->translate('Group Memberships'); ?></h3>
<?php if (! $this->compact): ?>
<?= $this->sortBox ?>
<?php endif ?>
<?= $this->limiter ?>
<?= $this->paginator ?>
<?php if (! $this->compact): ?>
<?= $this->filterEditor ?>
<?php endif ?>
<?php if (count($memberships) > 0): ?> <?php if (count($memberships) > 0): ?>
<table data-base-target="_next" class="action membership-list"> <table data-base-target="_next" class="action membership-list alternating">
<thead> <thead>
<tr> <tr>
<th class="membership-group"><?= $this->translate('Group'); ?></th> <th class="membership-group"><?= $this->translate('Group'); ?></th>
@ -95,17 +94,17 @@ if ($this->hasPermission('config/authentication/users/edit') && $backend instanc
<?php endif ?> <?php endif ?>
<?php if ($showCreateMembershipLink): ?> <?php if ($showCreateMembershipLink): ?>
<?= $this->qlink( <?= $this->qlink(
$this->translate('Create new membership'), $this->translate('Create New Membership'),
'user/createmembership', 'user/createmembership',
array( array(
'backend' => $backend->getName(), 'backend' => $backend->getName(),
'user' => $user->user_name 'user' => $user->user_name
), ),
array( array(
'icon' => 'plus', 'icon' => 'plus',
'data-base-target' => '_next', 'data-base-target' => '_next',
'class' => 'membership-create' 'class' => 'membership-create'
) )
) ?> ); ?>
<?php endif ?> <?php endif ?>
</div> </div>

View File

@ -186,7 +186,21 @@ tr[href]:hover {
} }
/* END of HOVER colors */ /* END of HOVER colors */
/* TODO: get rid of most if not all styles below this line */ div.controls table.user-header {
th {
width: 9em;
line-height: 1.5em;
font-size: 0.9em;
}
td {
line-height: 1.5em;
font-size: 0.9em;
}
}
/* TODO: get rid of most if not all styles below this line,
by ensuring to not to make everything look ugly... */
div.content.users { div.content.users {
table.user-list { table.user-list {
th.user-remove { th.user-remove {