Skip to content
Snippets Groups Projects
Commit f7a498ed authored by Jonathan Foucher's avatar Jonathan Foucher
Browse files

Add state column for non-admins. Fixes 4 of #649

parent 4a71d76c
No related branches found
No related tags found
No related merge requests found
......@@ -195,6 +195,7 @@ class NotificationController extends CRUDController
];
} else {
$reponse['data'][] = [
'state' => $notification->getReadAt() ? $read : $unread,
'module' => $this->translator->trans($notification->getModule()),
'action' => $this->translator->trans($notification->getAction()),
'name' => $nameHtml,
......@@ -377,6 +378,7 @@ class NotificationController extends CRUDController
];
}
return [
'state',
'module',
'action',
'name',
......
......@@ -34,7 +34,6 @@
<table id="table" class="table table-bordered table-hover">
<thead>
<tr>
{% if is_granted('ROLE_ADMIN') %}
<th>
<select class="form-control" id="search_state" style="width: 100%;">
<option value="" selected>{{ 'notification.notification.list.state'|trans }}</option>
......@@ -43,7 +42,6 @@
{% endfor %}
</select>
</th>
{% endif %}
<th>
<select class="form-control" id="search_module" style="width: 100%;">
<option value="" selected>{{ 'notification.notification.list.module'|trans }}</option>
......@@ -82,9 +80,7 @@
{% endif %}
</tr>
<tr>
{% if is_granted('ROLE_ADMIN') %}
<th>{{ 'notification.notification.list.state'|trans }}</th>
{% endif %}
<th>{{ 'notification.notification.list.module'|trans }}</th>
<th>{{ 'notification.notification.list.action'|trans }}</th>
<th>{{ 'notification.notification.list.name'|trans }}</th>
......@@ -135,6 +131,7 @@
] %}
{% else %}
{% set columns = [
{"data": "state"},
{"data": "module"},
{"data": "action"},
{"data": "name"},
......@@ -232,31 +229,35 @@
{% else %}
$('#search_state').off('change');
$('#search_state').change(function(){
oTable.column('0').search($(this).val()).draw();
});
$('#search_module').off('change');
$('#search_module').change(function(){
oTable.column('0').search($(this).val()).draw();
oTable.column('1').search($(this).val()).draw();
});
$('#search_action').off('change');
$('#search_action').change(function(){
oTable.column('1').search($(this).val()).draw();
oTable.column('2').search($(this).val()).draw();
});
$('#search_name').off('keyup');
$('#search_name').keyup($.debounce(250, function(){
oTable.column('2').search($(this).val()).draw();
oTable.column('3').search($(this).val()).draw();
}));
$('#search_date').off('change');
$('#search_date').change(function(){
oTable.column('4').search($(this).val()).draw() ;
oTable.column('5').search($(this).val()).draw() ;
});
$('#search_user_name').off('keyup');
$('#search_user_name').keyup($.debounce(250, function(){
oTable.column('5').search($(this).val()).draw();
oTable.column('6').search($(this).val()).draw();
}));
{% endif %}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment