@extends('dashboard.core') @section('dashboard-body') @if($help_text != '')
{!! $help_text !!}
@endif
@foreach($columns as $column)
@php $value = $item !== null ? $item[$column['name']] : ''; $type = $id == 'new' && array_key_exists('type-new', $column) ? $column['type-new'] : $column['type']; $ext = array_key_exists('ext', $column) ? $column['ext'] : $default_img_ext; @endphp @if($type == 'hidden') @elseif($type == 'user') @elseif($type != 'display' || $id != 'new')
@if($type == 'string') @elseif($type == 'text') @elseif($type == 'currency') @elseif($type == 'date' || $type == 'date-time') @elseif($type == 'mkd')
@elseif($type == 'select') @elseif($type == 'list') @php $list_model = App\Dashboard::getModel($value['model']); $list_columns = $list_model::$dashboard_columns; @endphp
@foreach($list_columns as $list_column)
@if($list_column['type'] == 'string') @elseif($list_column['type'] == 'image') @endif
@endforeach
@if($id != 'new') @foreach($value['list'] as $row)
@foreach($list_columns as $list_column) @if($list_column['type'] == 'string') @php $list_column_value = $row[$list_column['name']] @endphp @elseif($list_column['type'] == 'image') @php $list_column_item = $list_model::find($row['id']); $list_column_image_ext = array_key_exists('ext', $list_column) ? $list_column['ext'] : $default_img_ext; $list_column_image_path = $list_model->getUploadsPath('image') . $row['id'] . '-' . $list_column['name'] . '.' . $list_column_image_ext; $list_column_value = file_exists(public_path($list_column_image_path)) ? $list_column_image_path . '?version=' . $list_column_item->timestamp() : ''; @endphp {{ $list_column_image_path }} @endif
@endforeach
@endforeach @endif
@elseif($type == 'image') @php $current_image = "/uploads/$model/img/$id-" . $column['name'] . '.' . $ext; @endphp
@if(file_exists(base_path() . '/public' . $current_image))
@if(array_key_exists('delete', $column) && $column['delete']) Delete Image @endif
@endif @elseif($type == 'file') @php $current_file = "/uploads/$model/files/$id-" . $column['name'] . '.' . $column['ext']; @endphp
@if(file_exists(base_path() . '/public' . $current_file))
View {{ strtoupper($column['ext']) }} @if(array_key_exists('delete', $column) && $column['delete']) Delete {{ strtoupper($column['ext']) }} @endif
@endif @elseif($type == 'display')
{{ $value }}
@endif
@endif
@endforeach
@endsection