@php use App\Helpers\Template as Template; use App\Helpers\Hightlight as Hightlight; use App\Models\CategoryModel; @endphp
@if (count($items) > 0) @foreach ($items as $key => $val) @php $index = $key + 1; $class = ($index % 2 == 0) ? "even" : "odd"; $id = $val['id']; $name = str_repeat('|----', $val["depth"]) . $val["name"]; $status = Template::showItemStatus($controllerName, $id, $val['status']); $isHome = Template::showItemIsHome($controllerName, $id, $val['is_home']); $display = Template::showItemSelect($controllerName, $id, $val['display'], 'display'); $createdHistory = Template::showItemHistory($val['created_by'], $val['created']); $modifiedHistory = Template::showItemHistory($val['modified_by'], $val['modified']); $listBtnAction = Template::showButtonAction($controllerName, $id); $node = CategoryModel::find($id); $getNextSibling = $node->getNextSibling(); $getPrevSibling = $node->getPrevSibling(); $upButton = 'Up'; $downButton = 'Down'; if ($getPrevSibling == null) { $upButton = ''; } if ($getNextSibling == null) { $downButton = ''; } $ordering = $upButton . $downButton; @endphp @endforeach @else @include('admin.templates.list_empty', ['colspan' => 9]) @endif
# Name Ordering Trạng thái Hiện thị Home Kiểu hiện thị Tạo mới Chỉnh sửa Hành động
{{ $index }} {!! $name !!} {!! $ordering !!} {!! $status !!} {!! $isHome !!} {!! $display !!} {!! $createdHistory !!} {!! $modifiedHistory !!} {!! $listBtnAction !!}