app/controllers/UserController.php: adding activity action
This commit is contained in:
parent
3f99105588
commit
5890337179
2 changed files with 43 additions and 1 deletions
|
|
@ -3,7 +3,8 @@
|
|||
namespace App\Controller;
|
||||
|
||||
use App\Controller\ControllerBase,
|
||||
App\Form\UserSettings as UserSettingsForm;
|
||||
App\Form\UserSettings as UserSettingsForm,
|
||||
App\Model\Data\ActivityLog;
|
||||
|
||||
class UserController extends ControllerBase
|
||||
{
|
||||
|
|
@ -34,4 +35,14 @@ class UserController extends ControllerBase
|
|||
|
||||
$this->view->form = $form;
|
||||
}
|
||||
|
||||
public function activityAction($page = 1)
|
||||
{
|
||||
$user = $this->_getAuth()->getUser();
|
||||
|
||||
$paginator = ActivityLog::getPaginationList($user->getId(), $page);
|
||||
|
||||
$this->view->page = $paginator->getPaginate();
|
||||
$this->view->pagination_url = '/user/activity/';
|
||||
}
|
||||
}
|
||||
|
|
|
|||
31
app/views/user/activity.volt
Normal file
31
app/views/user/activity.volt
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
|
||||
<div class="section">
|
||||
|
||||
<h3>Activity Log</h3>
|
||||
|
||||
<table class="table table-condensed table-striped table-hover">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Date</th>
|
||||
<th>Ip</th>
|
||||
<th>Message</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody>
|
||||
{% for item in page.items %}
|
||||
<tr>
|
||||
<td>{{ item.getTimestamp() }}</td>
|
||||
<td>{{ item.getIp() }}</td>
|
||||
<td>{{ item.getMessage() }}</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<nav class="text-center" aria-label="Page navigation">
|
||||
{{ partial('pagination') }}
|
||||
</nav>
|
||||
</div>
|
||||
|
||||
|
||||
Reference in a new issue