Skip to content

Commit

Permalink
Updated styles
Browse files Browse the repository at this point in the history
  • Loading branch information
rmathis committed Feb 9, 2021
1 parent badec4a commit 765768d
Show file tree
Hide file tree
Showing 9 changed files with 1,154 additions and 46 deletions.
3 changes: 3 additions & 0 deletions Controller/GrouperGroupsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,14 @@ public function index() {

public function groupInfo() {
$name = urldecode($this->request->query['groupname']);

$details = $this->GrouperGroup->groupDescriptions($name);

$this->set('groupname', $name);
$this->set('title', _txt('pl.grouperlite.title.groupinfo'));
$this->set('groupergroupsdetail', $details[0]);

$this->set('isuserowner', $this->GrouperGroup->isUserOwner($this->userId));
}

public function groupOwner() {
Expand Down
2 changes: 2 additions & 0 deletions Model/GrouperAttribute.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ private function initApi() {
* @throws GrouperLiteException
*/
public function getGroupAttributes(string $groupName) {
$this->initApi();

$args = array();
$args['conditions']['groupName'] = $groupName;

Expand Down
28 changes: 15 additions & 13 deletions View/Elements/Components/navigation.ctp
Original file line number Diff line number Diff line change
Expand Up @@ -63,17 +63,19 @@
</div>
*/ ?>
</div>
<div class="align-self">
<?php
$createGroupUrl = $this->Html->url(
array(
'controller' => 'groupergroups',
'action' => 'groupcreateform'
)
);
?>
<a href="<?php echo $createGroupUrl; ?>" class="btn btn-link px-3 py-2">
<i class="fa fa-plus-circle"></i>&nbsp; <?php echo _txt('pl.grouperlite.nav.create-group'); ?>
</a>
</div>
<?php if ($isuserowner === 'T') { ?>
<div class="align-self">
<?php
$createGroupUrl = $this->Html->url(
array(
'controller' => 'groupergroups',
'action' => 'groupcreateform'
)
);
?>
<a href="<?php echo $createGroupUrl; ?>" class="btn btn-link px-3 py-2">
<i class="fa fa-plus-circle"></i>&nbsp; <?php echo _txt('pl.grouperlite.nav.create-group'); ?>
</a>
</div>
<?php } ?>
</nav>
16 changes: 11 additions & 5 deletions View/Elements/Components/subscriberList.ctp
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
<ul class="list-group list-group-flush">
<?php foreach ($subscribers as $sub): ?>
<li class="list-group-item"><?php echo $sub['name']; ?> - <?php echo $sub['email']; ?></li>
<?php endforeach; ?>
</ul>

<table class="table table-striped">
<tbody>
<?php foreach ($subscribers as $sub) : ?>
<tr>
<td><?php echo $sub['name']; ?></td>
<td><?php echo $sub['email']; ?></td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
110 changes: 110 additions & 0 deletions View/Elements/pagination.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
<nav aria-label="Page navigation example">
<ul class="pagination">
<li class="page-item"><a class="page-link" href="#">Previous</a></li>
<li class="page-item"><a class="page-link" href="#">1</a></li>
<li class="page-item"><a class="page-link" href="#">2</a></li>
<li class="page-item"><a class="page-link" href="#">3</a></li>
<li class="page-item"><a class="page-link" href="#">Next</a></li>
</ul>
</nav>

<nav aria-label="Page navigation example">
<span class="paginationCounter">
<?php
// pagination information "Page {:page} of {:pages}, Viewing {:start}-{:end} of {:count}"
print _txt('in.pagination.format');
?>
</span>
<?php if ($this->paginator->hasPage(2)) : ?>
<ul class="pagination">

<li class="page-item">
<?php
// Shows the first link <a class="page-link" href="#">1</a>
print $this->Paginator->first(_txt('op.first'));
?>
</li>
<li class="page-item">
<?php
// Shows the previous link
print $this->Paginator->prev(
_txt('op.previous'),
null,
null,
array('class' => 'disabled')
);
?>
</li>
<li class="page-item">
<?php
// Shows the page numbers
print $this->Paginator->numbers();
?>
</li>
<li class="page-item">
<?php
// Shows the next link
print $this->Paginator->next(
_txt('op.next'),
null,
null,
array('class' => 'disabled')
);
?>
</li>
<li class="page-item">
<?php
// Shows the last link
print $this->Paginator->last(_txt('op.last'));
?>
</li>
</ul>
<?php endif; ?>

<?php if ($this->paginator->hasPage(2)) : ?>
<?php
// show the Goto page form if there is more than 1 page
?>
<form id="goto-page" class="pagination-form" method="get" onsubmit="gotoPage(this.pageNum.value,
<?php print $this->Paginator->counter('{:pages}'); ?>,
'<?php print _txt('er.pagenum.nan'); ?>',
'<?php print _txt('er.pagenum.exceeded', array($this->Paginator->counter('{:pages}'))); ?>');
return false;">
<label for="pageNum"><?php print _txt('fd.page.goto'); ?></label>
<input type="text" size="3" name="pageNum" id="pageNum" />
<input type="submit" value="<?php print _txt('op.go'); ?>" />
</form>
<?php endif; ?>

<?php
// Provide a form for setting the page limit.
// Default is 25 records, current maximum is 100.
// For now we will simply hard-code the options from 25 - 100.
?>
<script type="text/javascript">
var recordCount = '<?php print $this->Paginator->params()['count']; ?>';
var currentPage = '<?php print $this->Paginator->params()['page']; ?>';
var currentLimit = '<?php print $this->Paginator->params()['limit']; ?>';
var currentPath = '<?php print filter_var($this->request->here, FILTER_SANITIZE_SPECIAL_CHARS); ?>';
var currentAction = '<?php print filter_var($this->request->action, FILTER_SANITIZE_SPECIAL_CHARS); ?>';
</script>
<form id="limit-page" class="pagination-form" method="get" onsubmit="limitPage(this.pageLimit.value,recordCount,currentPage,currentPath,currentAction); return false;">
<label for="pageLimit"><?php print _txt('fd.page.limit.display'); ?></label>
<select name="pageLimit" id="pageLimit">
<option value="25">25</option>
<option value="50">50</option>
<option value="75">75</option>
<option value="100">100</option>
</select>
<?php print _txt('fd.page.limit.records'); ?>
<input type="submit" value="<?php print _txt('op.go'); ?>" />
<script type="text/javascript">
$(function() {
// Check if the currentLimit holds an appropriate value on first load, and set the select option
if (currentLimit != '' && (currentLimit == '50' || currentLimit == '75' || currentLimit == '100')) {
$("#pageLimit").val(currentLimit);
}
});
</script>
</form>
</nav>
Loading

0 comments on commit 765768d

Please sign in to comment.