Skip to content

Commit

Permalink
Updated uii
Browse files Browse the repository at this point in the history
  • Loading branch information
rmathis committed Jul 23, 2021
1 parent ce8b675 commit 9d46f36
Show file tree
Hide file tree
Showing 9 changed files with 127 additions and 69 deletions.
2 changes: 1 addition & 1 deletion View/Elements/Components/optAction.ctp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
'id' => 'join-group.' . $idx
)); ?>
<?php print $this->Form->hidden('GroupName', array('default' => $group, 'id' => 'groupName.' . $idx)); ?>
<button class="btn btn-block btn-sm btn-<?php echo $member ? 'danger' : 'success'; ?>" type="submit">
<button class="btn btn-sm btn-<?php echo $member ? 'danger' : 'success'; ?>" type="submit">
<?php echo $member ? _txt('pl.grouperlite.action.leave') : _txt('pl.grouperlite.action.join') ?> &nbsp;
<i class="fa fa-<?php echo $member ? 'user-times' : 'users'; ?> fa-sm"></i>
</button>
Expand Down
17 changes: 0 additions & 17 deletions View/Elements/Components/search.ctp
Original file line number Diff line number Diff line change
@@ -1,20 +1,3 @@
<script type="text/javascript">
$(function() {
var collapse = $(".collapse"),
btn = $(".adv-search-link"),
open = false;

btn.addClass("active");
collapse.hide();
btn.click(function(ev) {
ev.preventDefault();
open = !open;
collapse.slideToggle();
btn.toggleClass('active');
btn.find('.fa').toggleClass('fa-caret-down').toggleClass('fa-caret-up');
});
});
</script>
<?php echo $this->Form->create(false, array(
'url' => array('controller' => 'grouper_groups', 'action' => $active),
'class' => 'search mb-4'
Expand Down
2 changes: 1 addition & 1 deletion View/Elements/base-styles.ctp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<style>
:root {
--red: #CC3333;
--red: #B32D2D;
--blue: #1D7AB4;
--green: #1D871D;
--orange: #faa732;
Expand Down
13 changes: 12 additions & 1 deletion View/GrouperGroups/base.ctp
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,15 @@ $this->Html->addCrumb(_txt('pl.grouperlite.crumb.root'), array('controller' => '
<!--<div class="ml-auto"><a href="#">Why Grouper?</a></div>-->
</div>
<?php echo $this->fetch('content'); ?>
</div>
</div>

<script>
$('.grouper-table .collapse-btn').on('click', function(ev) {
var btn = $(ev.currentTarget);
if (btn.hasClass('collapsed')) {
btn.find('i').removeClass('fa-caret-down').addClass('fa-caret-up');
} else {
btn.find('i').removeClass('fa-caret-up').addClass('fa-caret-down');
}
})
</script>
56 changes: 37 additions & 19 deletions View/GrouperGroups/groupmember.ctp
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,15 @@ $columns = [
'description' => 'pl.grouperlite.table.description',
'action' => 'pl.grouperlite.table.action'
];

if ($isuserowner !== 'T') {
array_splice($columns, 1, 1);
}

$numColumns = count($columns);
?>
<?php if (count($groupmemberships) > 0 || count($wgmemberships) > 0) : ?>
<div class="">
<div class="grouper-table">
<?php print $this->element("pagination", array(
'goto' => false,
'limit' => false,
Expand Down Expand Up @@ -43,7 +48,9 @@ $numColumns = count($columns);
'?' => array('groupname' => urlencode($group['name']))
)
) ?>" title="<?php echo $group['name']; ?>"><?php echo $group['friendlyName'] ?? "No Name"; ?></a></td>
<td>&mdash;</td>
<?php if ($isuserowner === 'T') { ?>
<td>&mdash;</td>
<?php } ?>
<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 @@ -59,28 +66,39 @@ $numColumns = count($columns);
<tbody>
<?php foreach ($wgmemberships as $wggroup) : ?>
<tr>
<td colspan="<?php echo $numColumns; ?>">
<p class="h6 fw-bold m-0"><?php echo $wggroup['WGName'] ?? "No Name"; ?></p>
<td colspan="<?php echo $numColumns - 1; ?>">
<button type="button" class="btn btn-link btn-text collapse-btn h6 fw-bold m-0 collapsed" data-toggle="collapse" data-target=".collapse-wg-<?php echo $wggroup['WGName']; ?>" role="button" aria-expanded="false">
<?php echo $wggroup['WGName'] ?? "No Name"; ?>
<i class="fa fa-caret-down fa-sm"></i>
</button>
</td>
<td>
<?php echo $wggroup['optOut'] ? $this->element('GrouperLite.Components/optAction', array(
'member' => $wggroup['optOut'],
'action' => 'leavegroup',
'group' => $wggroup['workingGroupId'],
'idx' => $key
)) : ''; ?>
</td>
</tr>
<?php foreach ($wggroup['Groups'] as $key => $group) : ?>
<tr>
<td class="pl-3"><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>
<tr class="collapse collapse-wg-<?php echo $wggroup['WGName']; ?>" id="collapse-wg-<?php echo $wggroup['WGName'] . '-' . $key; ?>">
<td class="pl-3">
<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>
<?php if ($isuserowner === 'T') { ?>
<td><?php echo $group['WGRole'] ?? _txt('pl.grouperlite.value.descr.zerostate'); ?></td>
<?php } ?>
<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; ?>
Expand Down
41 changes: 28 additions & 13 deletions View/GrouperGroups/groupoptin.ctp
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,15 @@ $columns = [
'description' => 'pl.grouperlite.table.description',
'action' => 'pl.grouperlite.table.action'
];

if ($isuserowner !== 'T') {
array_splice($columns, 1, 1);
}

$numColumns = count($columns);
?>
<?php if (count($groupoptins) > 0 || count($wgoptins) > 0) : ?>
<div class="">
<div class="grouper-table">
<?php print $this->element("pagination", array(
'goto' => false,
'limit' => false,
Expand Down Expand Up @@ -44,7 +49,9 @@ $numColumns = count($columns);
)
) ?>" title="<?php echo $group['name']; ?>"><?php echo $group['friendlyName'] ?? "No Name"; ?></a>
</td>
<td>&mdash;</td>
<?php if ($isuserowner === 'T') { ?>
<td>&mdash;</td>
<?php } ?>
<td><?php echo $group['description'] ?? _txt('pl.grouperlite.value.descr.zerostate'); ?></td>
<td>
<?php echo $this->element('GrouperLite.Components/optAction', array(
Expand All @@ -58,14 +65,25 @@ $numColumns = count($columns);
<?php endforeach; ?>
</tbody>
<tbody>
<?php foreach ($wgoptins as $wgoptin) : ?>
<?php foreach ($wgoptins as $i => $wgoptin) : ?>
<tr>
<td colspan="<?php echo $numColumns; ?>">
<p class="h6 fw-bold m-0"><?php echo $wgoptin['WGName'] ?? "No Name"; ?></p>
<td colspan="<?php echo $numColumns - 1; ?>">
<button type="button" class="btn btn-link btn-text collapse-btn h6 fw-bold m-0 collapsed" data-toggle="collapse" data-target=".collapse-wg-<?php echo $wgoptin['WGName']; ?>" role="button" aria-expanded="false">
<?php echo $wgoptin['WGName'] ?? "No Name"; ?>
<i class="fa fa-caret-down fa-sm"></i>
</button>
</td>
<td>
<?php echo $this->element('GrouperLite.Components/optAction', array(
'member' => $wgoptin['member'],
'action' => 'joingroup',
'group' => $wgoptin['workingGroupId'],
'idx' => $key
)); ?>
</td>
</tr>
<?php foreach ($wgoptin['Groups'] as $key => $group) : ?>
<tr>
<tr class="collapse collapse-wg-<?php echo $wgoptin['WGName']; ?>" id="collapse-wg-<?php echo $wgoptin['WGName'] . '-' . $key; ?>">
<td class="pl-3"><a href="<?php echo $this->Html->url(
array(
'controller' => 'grouper_groups',
Expand All @@ -74,15 +92,12 @@ $numColumns = count($columns);
)
) ?>" 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>
<?php if ($isuserowner === 'T') { ?>
<td><?php echo $group['WGRole'] ?? _txt('pl.grouperlite.value.descr.zerostate'); ?></td>
<?php } ?>
<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; ?>
Expand Down
34 changes: 22 additions & 12 deletions View/GrouperGroups/groupowner.ctp
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,15 @@ $columns = [
'status' => 'pl.grouperlite.table.status',
'action' => 'pl.grouperlite.table.action'
];

if ($isuserowner !== 'T') {
array_splice($columns, 1, 1);
}

$numColumns = count($columns);
?>
<?php if (count($groupsowners) > 0 || count($wgowners) > 0) : ?>
<div class="">
<div class="grouper-table">
<?php print $this->element("pagination", array(
'goto' => false,
'limit' => false,
Expand All @@ -36,11 +41,11 @@ $numColumns = count($columns);
</td>
</tr>
<?php if (count($groupsowners) < 1) : ?>
<tr>
<td colspan="<?php echo $numColumns; ?>">
You are not a manager of any ad-hoc groups.
</td>
</tr>
<tr>
<td colspan="<?php echo $numColumns; ?>">
You are not a manager of any ad-hoc groups.
</td>
</tr>
<?php endif; ?>
<?php foreach ($groupsowners as $group) : ?>
<tr>
Expand All @@ -52,16 +57,18 @@ $numColumns = count($columns);
)
) ?>" title="<?php echo $group['name']; ?>"><?php echo $group['friendlyName'] ?? "No Name"; ?></a>
</td>
<td>&mdash;</td>
<?php if ($isuserowner === 'T') { ?>
<td>&mdash;</td>
<?php } ?>
<td><?php echo $group['description'] ?? "No Description"; ?></td>
<td><?php echo isset($group['enabled']) && $group['enabled'] === 'T' ? 'Enabled' : 'Disabled'; ?></td>
<td class="text-center">
<span class="d-flex flex-column flex-lg-row justify-content-between align-items-center">
<button class="btn btn-grouper btn btn-primary btn btn-block" disabled>
<span class="d-flex flex-column flex-lg-row justify-content-center align-items-center">
<button class="btn btn-grouper btn btn-primary" disabled>
<?php echo _txt('pl.grouperlite.action.edit-group'); ?> &nbsp;
<i class="fa fa-pencil fa-sm"></i>
</button>
<?php /*<button class="btn btn-grouper btn btn-danger btn btn-block ml-1 mt-0" disabled>
<?php /*<button class="btn btn-grouper btn btn-danger ml-1 mt-0" disabled>
<?php echo _txt('pl.grouperlite.action.disable-group'); ?> &nbsp;
<i class="fa fa-ban fa-sm"></i>
</button>*/ ?>
Expand All @@ -74,11 +81,14 @@ $numColumns = count($columns);
<?php foreach ($wgowners as $wgowner) : ?>
<tr>
<td colspan="<?php echo $numColumns; ?>">
<p class="h6 fw-bold m-0"><?php echo $wgowner['WGName'] ?? "No Name"; ?></p>
<button type="button" class="btn btn-link btn-text collapse-btn h6 fw-bold m-0 collapsed" data-toggle="collapse" data-target=".collapse-wg-<?php echo $wgowner['WGName']; ?>" role="button" aria-expanded="false">
<?php echo $wgowner['WGName'] ?? "No Name"; ?>
<i class="fa fa-caret-down fa-sm"></i>
</button>
</td>
</tr>
<?php foreach ($wgowner['Groups'] as $key => $group) : ?>
<tr>
<tr class="collapse collapse-wg-<?php echo $wgowner['WGName']; ?>" id="collapse-wg-<?php echo $wgowner['WGName'] . '-' . $key; ?>">
<td class="pl-3"><a href="<?php echo $this->Html->url(
array(
'controller' => 'grouper_groups',
Expand Down
2 changes: 1 addition & 1 deletion webroot/css/co-grouper-base.css
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
:root {
--red: #912929;
--red: #CC3333;
--blue: #1D7AB4;
--green: #22AA22;
--teal: #1c6070;
Expand Down
29 changes: 25 additions & 4 deletions webroot/css/co-grouper-plugin.css
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,7 @@
}

.btn-sm {
padding: 0.6rem 1rem;
font-size: 1rem;
line-height: 1;
font-size: 0.75rem;
border-radius: .2rem;
}

Expand Down Expand Up @@ -73,8 +71,12 @@ a {
min-width: 200px;
}

#grouper-plugin .table thead th.group.role {
min-width: 5%;
}

#grouper-plugin .table thead th.group.description {
width: auto;
width: 40%;
}

#grouper-plugin .table thead th.group.action {
Expand Down Expand Up @@ -131,6 +133,19 @@ a {
#grouper-plugin .btn.btn-link.btn-text {
padding: 0;
margin: 0;
color: inherit;
text-transform: none;
}

#grouper-plugin .btn.btn-link.btn-text {
padding: 0;
margin: 0;
color: inherit;
text-transform: none;
}

#grouper-plugin .btn.btn-link.btn-text.h6 {
font-size: 1rem;
}

#grouper-plugin .paging {
Expand Down Expand Up @@ -276,4 +291,10 @@ a.list-group-item-action:hover .fa {

.radio .form-check-inline label {
margin-bottom: 0;
}

.table .collapsing {
-webkit-transition: none;
transition: none;
display: none;
}

0 comments on commit 9d46f36

Please sign in to comment.