mirror of
https://github.com/slawkens/myaac.git
synced 2025-04-26 17:29:21 +02:00
Sort changelogs by date + make sortable in admin panel
This commit is contained in:
parent
9c60beeed0
commit
1423046039
@ -19,7 +19,7 @@ $next_page = false;
|
||||
|
||||
$canEdit = hasFlag(FLAG_CONTENT_NEWS) || superAdmin();
|
||||
|
||||
$changelogs = Changelog::isPublic()->orderByDesc('id')->limit($limit + 1)->offset($offset)->get()->toArray();
|
||||
$changelogs = Changelog::isPublic()->orderByDesc('date')->limit($limit + 1)->offset($offset)->get()->toArray();
|
||||
|
||||
$i = 0;
|
||||
foreach($changelogs as $key => &$log)
|
||||
|
@ -27,7 +27,7 @@
|
||||
{% for log in changelogs %}
|
||||
<tr>
|
||||
<td>{{ log.id }}</td>
|
||||
<td>{{ log.date|date("j.m.Y") }}</td>
|
||||
<td data-sort="{{ log.date }}">{{ log.date|date("j.m.Y") }}</td>
|
||||
<td>{{ truncate(log.body|raw,20) }}</td>
|
||||
<td><img src="{{ constant('BASE_URL') }}images/changelog/{{ log.type }}.png" alt="icon" title="{{ log.type|capitalize }}"/> {{ log.type|capitalize }}</td>
|
||||
<td><img src="{{ constant('BASE_URL') }}images/changelog/{{ log.where }}.png" alt="icon" title="{{ log.where|capitalize }}"/> {{ log.where|capitalize }}</td>
|
||||
@ -75,7 +75,7 @@
|
||||
|
||||
$('.tb_datatable').DataTable({
|
||||
"order": [[0, "desc"]],
|
||||
"columnDefs": [{targets: [1, 2,4,5],orderable: false}]
|
||||
"columnDefs": [{targets: [2, 5], orderable: false}]
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
Loading…
x
Reference in New Issue
Block a user