php-censor/PHPCI/View/User/index.phtml
2014-04-30 14:13:07 +01:00

68 lines
1.9 KiB
PHTML

<div id="title">
<h1>Users</h1>
</div>
<div class="row">
<div class="col-lg-3">
<div class="panel panel-default">
<div class="panel-heading">
<h4 class="panel-title">Options</h4>
</div>
<div class="list-group">
<?php if($this->User()->getIsAdmin()): ?>
<a class="list-group-item" href="<?php echo PHPCI_URL ?>user/add"><i class="icon-plus-sign"></i> Add User</a>
<?php endif; ?>
</div>
</div>
</div>
<div class="col-lg-9">
<table class="table table-striped table-bordered">
<thead>
<tr>
<th>Email Address</th>
<th>Name</th>
<th>Administrator</th>
<th style="width: 100px"></th>
</tr>
</thead>
<tbody id="users">
<?php foreach($users['items'] as $user): ?>
<?php
switch($user->getIsAdmin())
{
case 0:
$cls = '';
$status = 'No';
break;
case 1:
$cls = 'warning';
$status = 'Yes';
break;
}
?>
<tr class="<?php print $cls; ?>">
<td><a href="<?php echo PHPCI_URL ?>user/edit/<?php print $user->getId(); ?>"><?php print $user->getEmail(); ?></a></td>
<td><?php print htmlspecialchars($user->getName()); ?></td>
<td><?php print $status; ?></td>
<td>
<?php if($this->User()->getIsAdmin()): ?>
<div class="btn-group">
<a class="btn btn-default btn-small" href="<?php echo PHPCI_URL ?>user/edit/<?php print $user->getId(); ?>">Edit</a>
<button class="btn btn-default btn-small dropdown-toggle" data-toggle="dropdown">
<span class="caret"></span>
</button>
<ul class="dropdown-menu">
<li><a href="<?php echo PHPCI_URL ?>user/delete/<?php print $user->getId(); ?>" class="phpci-app-delete-user">Delete User</a></li>
</ul>
</div>
<?php endif; ?>
</td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
</div>
</div>