@extends('voyager::master') @section('page_title', __('voyager::generic.viewing').' '.$dataType->getTranslatedAttribute('display_name_plural')) @section('page_header')

{{ $dataType->getTranslatedAttribute('display_name_plural') }}

@can('add', app($dataType->model_name)) {{ __('voyager::generic.add_new') }} @endcan @can('delete', app($dataType->model_name)) @include('voyager::partials.bulk-delete') @endcan @can('edit', app($dataType->model_name)) @if(isset($dataType->order_column) && isset($dataType->order_display_column)) {{ __('voyager::bread.order') }} @endif @endcan @can('delete', app($dataType->model_name)) @if($usesSoftDeletes) @endif @endcan @foreach($actions as $action) @if (method_exists($action, 'massAction')) @include('voyager::bread.partials.actions', ['action' => $action, 'data' => null]) @endif @endforeach @php $model_filters = []; foreach($dataType->browseRows as $row) { if(isset($row->details->browse_filter)) { $model_filters[] = [ 'filter_items' => build_flat_from_tree(flat_to_tree(app($row->details->model)->get()->toArray())), 'filter_title' => $row->display_name, 'filter_column' => $row->details->column, 'filter_key' => $row->details->key, 'filter_label' => $row->details->label, ]; } } @endphp @if(count($model_filters) > 0)
@foreach($model_filters as $key => $filter) @endforeach
@endif @include('voyager::multilingual.language-selector')
@stop @php $extra_details = json_decode($dataType->extra_details); // Set specified columns order $dataType->browseRows = $dataType->browseRows->sortBy(function ($row, $key) use ($extra_details) { if (isset($extra_details->browse_order)) { return get_index_by_name($extra_details->browse_order, $row->field); } else { return isset($row->details->browse_order)? $row->details->browse_order : 0; } }); // Correct Index Column for sorting in the table $orderColumn[0][0] = $dataType->browseRows->pluck('field')->search($orderBy) + ($showCheckboxColumn ? 1 : 0); @endphp @section('content')
@include('voyager::alerts')
@if ($isServerSide) @endif
@if($showCheckboxColumn) @endif @foreach($dataType->browseRows as $row) @endforeach @foreach($dataTypeContent as $data) @if($showCheckboxColumn) @endif @foreach($dataType->browseRows as $row) @php if ($data->{$row->field.'_browse'}) { $data->{$row->field} = $data->{$row->field.'_browse'}; } @endphp @endforeach @endforeach
details->browse_width)) style="width:{{ $row->details->browse_width }}"@endif> @if ($isServerSide) @endif @if(isset($row->details->browse_title)) {{ $row->details->browse_title }} @else {{ $row->getTranslatedAttribute('display_name') }} @endif @if ($isServerSide) @if ($row->isCurrentSortField($orderBy)) @if ($sortOrder == 'asc') @else @endif @endif @endif {{ __('voyager::generic.actions') }}
details->browse_font_size)) style="font-size:{{ $row->details->browse_font_size }}"@endif> @if (isset($row->details->view)) @include($row->details->view, ['row' => $row, 'dataType' => $dataType, 'dataTypeContent' => $dataTypeContent, 'content' => $data->{$row->field}, 'action' => 'browse', 'view' => 'browse', 'options' => $row->details]) {{-- FIELD IMAGE TYPE --}} @elseif($row->type == 'image') {{-- FIELD ADVANCED MEDIA IMAGE TYPE --}} @elseif($row->type == 'adv_image') @if($adv_image = $data->getFirstMedia($row->field)) @endif {{-- FIELD ADVANCED MEDIA FILES TYPE --}} @elseif($row->type == 'adv_media_files') @if($adv_media_files = $data->getMedia($row->field)->take(3)) @foreach($adv_media_files as $key => $adv_file) @if(explode('/', $adv_file->mime_type)[0] === 'image') @else @endif @endforeach @endif {{-- FIELD RELATION TYPE --}} @elseif($row->type == 'relationship') @include('voyager::formfields.relationship', ['view' => 'browse','options' => $row->details]) {{-- FIELD SELECT MULTIPLE TYPE --}} @elseif($row->type == 'select_multiple') @if(property_exists($row->details, 'relationship')) @foreach($data->{$row->field} as $item) {{ $item->{$row->field} }} @endforeach @elseif(property_exists($row->details, 'options')) @if (!empty(json_decode($data->{$row->field}))) @foreach(json_decode($data->{$row->field}) as $item) @if (@$row->details->options->{$item}) {{ $row->details->options->{$item} . (!$loop->last ? ', ' : '') }} @endif @endforeach @else {{ __('voyager::generic.none') }} @endif @endif {{-- FIELD MULTIPLE CHECKBOX TYPE --}} @elseif($row->type == 'multiple_checkbox' && property_exists($row->details, 'options')) @if (@count(json_decode($data->{$row->field})) > 0) @foreach(json_decode($data->{$row->field}) as $item) @if (@$row->details->options->{$item}) {{ $row->details->options->{$item} . (!$loop->last ? ', ' : '') }} @endif @endforeach @else {{ __('voyager::generic.none') }} @endif {{-- FIELD DROPDOWN SELECT TYPE --}} @elseif(($row->type == 'select_dropdown' || $row->type == 'radio_btn') && property_exists($row->details, 'options')) {!! $row->details->options->{$data->{$row->field}} ?? '' !!} {{-- FIELD ADVANCED TREE DROPDOWN SELECT TYPE --}} @elseif(($row->type == 'adv_select_dropdown_tree')) @if(!empty($data->{$row->field})) {{ $data->{$row->details->relationship->field}[$row->details->relationship->label] }} @endif {{-- FIELD DATE OR TIMESTUMP TYPE --}} @elseif($row->type == 'date' || $row->type == 'timestamp') @if ( property_exists($row->details, 'format') && !is_null($data->{$row->field}) ) {{ \Carbon\Carbon::parse($data->{$row->field})->formatLocalized($row->details->format) }} @else {{ $data->{$row->field} }} @endif {{-- FIELD CHECKBOX TYPE --}} @elseif($row->type == 'checkbox') @if(property_exists($row->details, 'on') && property_exists($row->details, 'off')) @if(property_exists($row->details, 'browse_inline_checkbox') || property_exists($row->details, 'browse_inline_editor')) {$row->field}) checked @endif class="tiny-toggle" data-tt-type="dot" data-tt-size="tiny"> @else @if($data->{$row->field}) {{ $row->details->on }} @else {{ $row->details->off }} @endif @endif @else {{ $data->{$row->field} }} @endif {{-- FIELD COLOR TYPE --}} @elseif($row->type == 'color') {{ $data->{$row->field} }} {{-- FIELD TEXT OR NUMBER TYPE --}} @elseif($row->type == 'text' || $row->type == 'number') @include('voyager::multilingual.input-hidden-bread-browse')
@if(isset($row->details->browse_inline_editor))
type == 'number') type="number" @else type="text" @endif name="{{$row->field}}" value="{{ $data->{$row->field} }}">
@endif
{{-- FIELD TEXT AREA TYPE --}} @elseif($row->type == 'text_area') @include('voyager::multilingual.input-hidden-bread-browse')
{{ mb_strlen( $data->{$row->field} ) > 200 ? mb_substr($data->{$row->field}, 0, 200) . ' ...' : $data->{$row->field} }}
{{-- FIELD FILE TYPE --}} @elseif($row->type == 'file' && !empty($data->{$row->field}) ) @include('voyager::multilingual.input-hidden-bread-browse') @if(json_decode($data->{$row->field}) !== null) @foreach(json_decode($data->{$row->field}) as $file) {{ $file->original_name ?: '' }}
@endforeach @else Download @endif {{-- FIELD RICH TEXT TYPE --}} @elseif($row->type == 'rich_text_box') @include('voyager::multilingual.input-hidden-bread-browse')
{{ mb_strlen( strip_tags($data->{$row->field}, '') ) > 200 ? mb_substr(strip_tags($data->{$row->field}, ''), 0, 200) . ' ...' : strip_tags($data->{$row->field}, '') }}
{{-- FIELD COORDINATES TYPE --}} @elseif($row->type == 'coordinates') @include('voyager::partials.coordinates-static-image') {{-- FIELD MULTIPLE IMAGES TYPE --}} @elseif($row->type == 'multiple_images') @php $images = json_decode($data->{$row->field}); @endphp @if($images) @php $images = array_slice($images, 0, 3); @endphp @foreach($images as $image) @endforeach @endif {{-- FIELD MEDIA PICKER TYPE --}} @elseif($row->type == 'media_picker') @php if (is_array($data->{$row->field})) { $files = $data->{$row->field}; } else { $files = json_decode($data->{$row->field}); } @endphp @if ($files) @if (property_exists($row->details, 'show_as_images') && $row->details->show_as_images) @foreach (array_slice($files, 0, 3) as $file) @endforeach @else
    @foreach (array_slice($files, 0, 3) as $file)
  • {{ $file }}
  • @endforeach
@endif @if (count($files) > 3) {{ __('voyager::media.files_more', ['count' => (count($files) - 3)]) }} @endif @elseif (is_array($files) && count($files) == 0) {{ trans_choice('voyager::media.files', 0) }} @elseif ($data->{$row->field} != '') @if (property_exists($row->details, 'show_as_images') && $row->details->show_as_images) @else {{ $data->{$row->field} }} @endif @else {{ trans_choice('voyager::media.files', 0) }} @endif {{-- FIELD GROUP TYPE --}} @elseif($row->type == 'adv_fields_group')
@php $group = json_decode($data->{$row->field}); if (!isset($group->fields) && isset($row->details->fields)) { $fields = $row->details->fields; } else { $fields = $group->fields; } @endphp @if(isset($fields)) @foreach($fields as $key => $field) @if(!empty($field->value)) @else @endif @endforeach @else @endif @if(property_exists($row->details, 'browse_inline_editor')) @endif
@elseif($row->type == 'adv_json' || $row->type == 'adv_related' || $row->type == 'adv_page_layout' || $row->type == 'adv_inline_set') @lang('voyager-extension::bread.no_data_can_be_displayed') {{-- FIELD OTHER TYPES --}} @else @include('voyager::multilingual.input-hidden-bread-browse') {{ $data->{$row->field} }} @endif
@foreach($actions as $action) @if (!method_exists($action, 'massAction')) @include('voyager::bread.partials.actions', ['action' => $action]) @endif @endforeach
@if ($isServerSide)
{{ trans_choice( 'voyager::generic.showing_entries', $dataTypeContent->total(), [ 'from' => $dataTypeContent->firstItem(), 'to' => $dataTypeContent->lastItem(), 'all' => $dataTypeContent->total() ]) }}
{{ $dataTypeContent->appends([ 's' => $search->value, 'filter' => $search->filter, 'key' => $search->key, 'order_by' => $orderBy, 'sort_order' => $sortOrder, 'showSoftDeleted' => $showSoftDeleted, ]) ->onEachSide(5) ->links('voyager-extension::bread.partials.pagination') }}
@endif
@stop @section('css') @if(!$dataType->server_side && config('dashboard.data_tables.responsive')) @endif @stop @section('javascript') @if(!$dataType->server_side && config('dashboard.data_tables.responsive')) @endif @stop