Skip to content

Commit

Permalink
Updated layout
Browse files Browse the repository at this point in the history
  • Loading branch information
rmathis committed Jul 7, 2021
1 parent b3161bb commit 36f63da
Show file tree
Hide file tree
Showing 4 changed files with 237 additions and 201 deletions.
1 change: 1 addition & 0 deletions Lib/lang.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@

'pl.grouperlite.table.name' => 'Name',
'pl.grouperlite.table.description' => 'Description',
'pl.grouperlite.table.role' => 'Role',
'pl.grouperlite.table.status' => 'Status',
'pl.grouperlite.table.action' => 'Action',
'pl.grouperlite.table.open' => 'Access',
Expand Down
69 changes: 41 additions & 28 deletions View/GrouperGroups/groupmember.ctp
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,15 @@
<?php $this->Html->addCrumb(_txt('pl.grouperlite.nav.memberships')); ?>
<?php echo $this->element('GrouperLite.Components/navigation-groups', array('active' => 'groupmember')); ?>
<?php echo $this->element('GrouperLite.Components/search', array('active' => 'groupmember')); ?>
<?php
$columns = [
'name' => 'pl.grouperlite.table.name',
'role' => 'pl.grouperlite.table.role',
'description' => 'pl.grouperlite.table.description',
'action' => 'pl.grouperlite.table.action'
];
$numColumns = count($columns);
?>
<?php if (count($groupmemberships) > 0 || count($wgmemberships) > 0) : ?>
<div class="">
<?php print $this->element("pagination", array(
Expand All @@ -14,12 +23,15 @@
<table class="table table-striped w-100 mb-0">
<thead>
<tr>
<th class="group name"><?php echo _txt('pl.grouperlite.table.name'); ?></th>
<th class="group description"><?php echo _txt('pl.grouperlite.table.description'); ?></th>
<th class="group action text-center"><?php echo _txt('pl.grouperlite.table.action'); ?></th>
<?php foreach ($columns as $key => $label) : ?>
<th class="group <?php echo $key === 'action' ? $key . ' text-center' : $key; ?>"><?php echo _txt($label); ?></th>
<?php endforeach; ?>
</tr>
</thead>
<tbody>
<tr>
<td colspan="<?php echo $numColumns; ?>">Ad-hoc groups</td>
</tr>
<?php foreach ($groupmemberships as $key => $group) : ?>
<tr>
<td><a href="<?php echo $this->Html->url(
Expand All @@ -29,6 +41,7 @@
'?' => array('groupname' => urlencode($group['name']))
)
) ?>" title="<?php echo $group['name']; ?>"><?php echo $group['friendlyName'] ?? "No Name"; ?></a></td>
<td>&mdash;</td>
<td><?php echo $group['description'] ?? _txt('pl.grouperlite.value.descr.zerostate'); ?></td>
<td>
<?php echo $group['optOut'] ? $this->element('GrouperLite.Components/optAction', array(
Expand All @@ -40,35 +53,35 @@
</td>
</tr>
<?php endforeach; ?>
</tbody>
<tbody>
<?php foreach ($wgmemberships as $wggroup) : ?>
<tr>
<td colspan="3">
<?php echo $wggroup['WGName'] ?? "No Name"; ?>
<table>
<?php foreach ($wggroup['Groups'] as $key => $group) : ?>
<tr>
<td><a href="<?php echo $this->Html->url(
array(
'controller' => 'grouper_groups',
'action' => 'groupinfo',
'?' => array('groupname' => urlencode($group['name']))
)
) ?>" title="<?php echo $group['name']; ?>"><?php echo $group['WGApp'] ?? "No Name"; ?></a></td>
<td><?php echo $group['WGRole'] ?? _txt('pl.grouperlite.value.descr.zerostate'); ?></td>
<td><?php echo $group['description'] ?? _txt('pl.grouperlite.value.descr.zerostate'); ?></td>
<td>
<?php echo $group['optOut'] ? $this->element('GrouperLite.Components/optAction', array(
'member' => $group['optOut'],
'action' => 'leavegroup',
'group' => $group['name'],
'idx' => $key
)) : ''; ?>
</td>
</tr>
<?php endforeach; ?>
</table>
<td colspan="<?php echo $numColumns; ?>">
<?php echo $wggroup['WGName'] ?? "No Name"; ?>
</td>
</tr>
<?php foreach ($wggroup['Groups'] as $key => $group) : ?>
<tr>
<td><a href="<?php echo $this->Html->url(
array(
'controller' => 'grouper_groups',
'action' => 'groupinfo',
'?' => array('groupname' => urlencode($group['name']))
)
) ?>" title="<?php echo $group['name']; ?>"><?php echo $group['WGApp'] ?? "No Name"; ?></a></td>
<td><?php echo $group['WGRole'] ?? _txt('pl.grouperlite.value.descr.zerostate'); ?></td>
<td><?php echo $group['description'] ?? _txt('pl.grouperlite.value.descr.zerostate'); ?></td>
<td>
<?php echo $group['optOut'] ? $this->element('GrouperLite.Components/optAction', array(
'member' => $group['optOut'],
'action' => 'leavegroup',
'group' => $group['name'],
'idx' => $key
)) : ''; ?>
</td>
</tr>
<?php endforeach; ?>
<?php endforeach; ?>
</tbody>
</table>
Expand Down
172 changes: 92 additions & 80 deletions View/GrouperGroups/groupoptin.ctp
Original file line number Diff line number Diff line change
Expand Up @@ -2,89 +2,101 @@
<?php $this->Html->addCrumb(_txt('pl.grouperlite.nav.groups-can-join')); ?>
<?php echo $this->element('GrouperLite.Components/navigation-groups', array('active' => 'groupoptin')); ?>
<?php echo $this->element('GrouperLite.Components/search', array('active' => 'groupoptin')); ?>
<?php
$columns = [
'name' => 'pl.grouperlite.table.name',
'role' => 'pl.grouperlite.table.role',
'description' => 'pl.grouperlite.table.description',
'action' => 'pl.grouperlite.table.action'
];
$numColumns = count($columns);
?>
<?php if (count($groupoptins) > 0 || count($wgoptins) > 0) : ?>
<div class="">
<?php print $this->element("pagination", array(
'goto' => false,
'limit' => false,
'numbers' => false,
'counter' => true,
'class' => 'counter'
)); ?>
<table class="table table-striped w-100 mb-0">
<thead>
<div class="">
<?php print $this->element("pagination", array(
'goto' => false,
'limit' => false,
'numbers' => false,
'counter' => true,
'class' => 'counter'
)); ?>
<table class="table table-striped w-100 mb-0">
<thead>
<tr>
<?php foreach ($columns as $key => $label) : ?>
<th class="group <?php echo $key === 'action' ? $key . ' text-center' : $key; ?>"><?php echo _txt($label); ?></th>
<?php endforeach; ?>
</tr>
</thead>
<tbody>
<tr>
<td colspan="<?php echo $numColumns; ?>">Ad-hoc groups</td>
</tr>
<?php foreach ($groupoptins as $key => $group) : ?>
<tr>
<td><a href="<?php echo $this->Html->url(
array(
'controller' => 'grouper_groups',
'action' => 'groupinfo',
'?' => array('groupname' => urlencode($group['name']))
)
) ?>" title="<?php echo $group['name']; ?>"><?php echo $group['friendlyName'] ?? "No Name"; ?></a>
</td>
<td>&mdash;</td>
<td><?php echo $group['description'] ?? _txt('pl.grouperlite.value.descr.zerostate'); ?></td>
<td>
<?php echo $this->element('GrouperLite.Components/optAction', array(
'member' => $group['member'],
'action' => 'joingroup',
'group' => $group['name'],
'idx' => $key
)); ?>
</td>
</tr>
<?php endforeach; ?>
</tbody>
<tbody>
<?php foreach ($wgoptins as $wgoptin) : ?>
<tr>
<td colspan="<?php echo $numColumns; ?>">
<?php echo $wgoptin['WGName'] ?? "No Name"; ?>
</td>
</tr>
<?php foreach ($wgoptin['Groups'] as $key => $group) : ?>
<tr>
<th class="group name"><?php echo _txt('pl.grouperlite.table.name'); ?></th>
<th class="group description"><?php echo _txt('pl.grouperlite.table.description'); ?></th>
<th class="group action text-center"><?php echo _txt('pl.grouperlite.table.action'); ?></th>
<td><a href="<?php echo $this->Html->url(
array(
'controller' => 'grouper_groups',
'action' => 'groupinfo',
'?' => array('groupname' => urlencode($group['name']))
)
) ?>" title="<?php echo $group['name']; ?>"><?php echo $group['WGApp'] ?? "No Name"; ?></a>
</td>
<td><?php echo $group['WGRole'] ?? _txt('pl.grouperlite.value.descr.zerostate'); ?></td>
<td><?php echo $group['description'] ?? _txt('pl.grouperlite.value.descr.zerostate'); ?></td>
<td>
<?php echo $this->element('GrouperLite.Components/optAction', array(
'member' => $group['member'],
'action' => 'joingroup',
'group' => $group['name'],
'idx' => $key
)); ?>
</td>
</tr>
</thead>
<tbody>
<?php foreach ($groupoptins as $key => $group) : ?>
<tr>
<td><a href="<?php echo $this->Html->url(
array(
'controller' => 'grouper_groups',
'action' => 'groupinfo',
'?' => array('groupname' => urlencode($group['name']))
)
) ?>" title="<?php echo $group['name']; ?>"><?php echo $group['friendlyName'] ?? "No Name"; ?></a>
</td>
<td><?php echo $group['description'] ?? _txt('pl.grouperlite.value.descr.zerostate'); ?></td>
<td>
<?php echo $this->element('GrouperLite.Components/optAction', array(
'member' => $group['member'],
'action' => 'joingroup',
'group' => $group['name'],
'idx' => $key
)); ?>
</td>
</tr>
<?php endforeach; ?>
<?php foreach ($wgoptins as $wgoptin) : ?>
<tr>
<td colspan="3">
<?php echo $wgoptin['WGName'] ?? "No Name"; ?>
<table>
<?php foreach ($wgoptin['Groups'] as $key => $group) : ?>
<tr>
<td><a href="<?php echo $this->Html->url(
array(
'controller' => 'grouper_groups',
'action' => 'groupinfo',
'?' => array('groupname' => urlencode($group['name']))
)
) ?>"
title="<?php echo $group['name']; ?>"><?php echo $group['WGApp'] ?? "No Name"; ?></a>
</td>
<td><?php echo $group['WGRole'] ?? _txt('pl.grouperlite.value.descr.zerostate'); ?></td>
<td><?php echo $group['description'] ?? _txt('pl.grouperlite.value.descr.zerostate'); ?></td>
<td>
<?php echo $this->element('GrouperLite.Components/optAction', array(
'member' => $group['member'],
'action' => 'joingroup',
'group' => $group['name'],
'idx' => $key
)); ?>
</td>
</tr>
<?php endforeach; ?>
</table>
</td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
<?php print $this->element("pagination", array(
'goto' => false,
'limit' => true,
'numbers' => true,
'counter' => false
)); ?>
</div>
<?php endforeach; ?>
<?php endforeach; ?>
</tbody>
</table>
<?php print $this->element("pagination", array(
'goto' => false,
'limit' => true,
'numbers' => true,
'counter' => false
)); ?>
</div>
<?php endif; ?>
<?php if (count($groupoptins) < 1 && count($wgoptins) < 1) : ?>
<div class="alert alert-info">
<p class="lead mb-0 text-center"><?php echo _txt('pl.grouperlite.groups.zero-state'); ?></p>
</div>
<div class="alert alert-info">
<p class="lead mb-0 text-center"><?php echo _txt('pl.grouperlite.groups.zero-state'); ?></p>
</div>
<?php endif; ?>
Loading

0 comments on commit 36f63da

Please sign in to comment.