getActions(); if (isset($actions->show) && \A7kz\Platform\Modules\Platform\Acl\Facades\Acl::isCanRun($app->getName(), 'show')) { $show = true; } ?> {!! $app->show_message() !!}
@if(!is_null($app->filter)) {{__("Фильтр")}} @endif
{{__($app->getUiTitle("grid"))}}
{!! $app->filter() !!}
@foreach($app->cols as $col) @endforeach @if(!$app->isReadonly()) @if(isset($app->action['row'])) @endif @endif @foreach($app->rows as $row) @php $href = !isset($targetLink) ? $app->getPath()."/show?pk=".$row->{$app->data->getPk()} : lurl("app/".$targetLink->application."/show?pk=".$row->{$app->data->getPk()}); @endphp getName(), 'show')) style="cursor: pointer;" class="grid-table-row" data-href="{{$href}}" @endif> @foreach($app->cols as $col) @endforeach @if(!$app->isReadonly()) @if(isset($app->action['row'])) @endif @endif @endforeach @if($app->rows->total() > $app->data->limit) @endif
{{__($col->caption)}} @if($col->name == $app->data->getSortField()) @if($app->data->getSortOrder() == 'asc') @else @endif @endif
style)) style="{{$row->style}}" @endif> @if($app->data->fields[$col->name]->getType() == DataTypes::Boolean) @if($row->{$col->name}) @elseif(isset($app->data->fields[$col->name]->nullable) && is_null($row->{$col->name})) @else @endif @elseif($app->data->fields[$col->name]->getType() == DataTypes::Date) {!! $row->{$col->name}?\Illuminate\Support\Carbon::parse($row->{$col->name})->format('d.m.Y'):'' !!} @elseif($app->data->fields[$col->name]->getType() == DataTypes::DateTime) {!! $row->{$col->name}?\Illuminate\Support\Carbon::parse($row->{$col->name})->format('d.m.Y H:i:s'):'' !!} @elseif($app->data->fields[$col->name]->getType() == DataTypes::Month) {!! $row->{$col->name}?\A7kz\Platform\Models\Month::get($row->{$col->name}):'' !!} @elseif($app->data->fields[$col->name]->getType() == DataTypes::Wysiwyg) {!! $row->{$col->name} !!} @elseif($app->data->fields[$col->name]->getType() == DataTypes::Foreign) @php $str = ''; if (isset($row->{$col->name . "_list_class_val"})) { $str = $row->{$col->name . "_list_class_val"}; } elseif (!empty($row->{$col->name})) { $templateKey = isset($app->data->fields[$col->name]->grid_template) ? 'grid_template' : (isset($app->data->fields[$col->name]->template) ? 'template' : null); if ($templateKey) { $str = $app->data->fields[$col->name]->{$templateKey}; $str = str_replace('{lk}', app()->getLocale(), $str); foreach ($app->data->fields[$col->name]->display as $item) { $str = str_replace("{" . $item . "}", $row->{$col->name . "_" . $item}, $str); } $str = preg_replace_callback('/\{(.*?)\}/', function ($matches) use ($row) { return $row->{$matches[1]} ?? ''; }, $str); } else { $str = ''; foreach ($app->data->fields[$col->name]->display as $item) { $str .= $row->{$col->name . "_" . $item} . " "; } } } @endphp {{ $str }} @elseif($app->data->fields[$col->name]->getType() == DataTypes::Json) {{var_dump(json_decode($row->{$col->name},true))}} @elseif($app->data->fields[$col->name]->getType() == DataTypes::Combined) {{ data_get(json_decode($row->{$app->data->fields[$col->name]->getDbFieldName()},true), $app->data->fields[$col->name]->getFieldName()) }} @elseif($app->data->fields[$col->name]->getType() == DataTypes::ExpirationStatus) @php $currentDate = Carbon::now(); $expirationDate = $row->{$col->name} != '' ? Carbon::parse($row->{$col->name}) : null; $creationDate = $app->data->fields[$col->name]->started_at_field ? Carbon::parse($row->{$app->data->fields[$col->name]->started_at_field} ?? null) : null; $isActive = match (true) { is_null($expirationDate) && is_null($creationDate) => true, is_null($creationDate) => $currentDate->lt($expirationDate), is_null($expirationDate) => $currentDate->gte($creationDate), default => ($currentDate->lt($expirationDate) and $currentDate->gte($creationDate)), }; $status = $isActive ? 'active' : 'inactive'; $text = $app->data->fields[$col->name]->text[$status] ?? ($isActive ? __('Активно') : __('Неактивно')); $icon = $isActive ? '' : ''; echo "$icon $text"; @endphp @else @php $truncateLength = $col->truncate_length ?? mb_strlen($row->{ $col->name }); if (mb_strlen($row->{ $col->name }) > $truncateLength) { $row->{ $col->name } = mb_substr($row->{ $col->name }, 0, $truncateLength) . '...'; } @endphp @if($col->link ?? false) {{ $row->{ $col->name } }} @else {{ $row->{ $col->name } }} @endif @endif action['row'])) style="width: {{count($app->action['row'])*40}}px" @endif> @foreach($app->action['row'] as $action=>$actionProperties) @if(!is_null($actionProperties)) @endif @endforeach
{{$app->rows->links()}}
@if(isset($app->getConfig()?->ui?->grid?->inject_component)) @foreach($app->getCOnfig()->ui->grid->inject_component as $inject_component) @endforeach @endif @if(isset($app->getConfig()?->ui?->grid?->inject_component)) @if(!empty($app->getConfig()->ui->grid->on_render_emit_functions)) @endif @endif