87 lines
4.3 KiB
PHP
87 lines
4.3 KiB
PHP
@extends($viewLayout)
|
|
|
|
@section('title', sprintf('%s - %s', transFb(sprintf('models.classes.%s', strtolower(Str::plural(class_basename($modelClass)))), Str::plural(class_basename($modelClass))), __('crud-policies::crud.view')))
|
|
@section('description', sprintf('%s %s', __('crud-policies::crud.view'), trans(class_basename($modelClass))))
|
|
@section('metaIndex', 'noindex,nofollow')
|
|
|
|
@section('content')
|
|
<div class="card">
|
|
@include('crud-policies::crud.modules.flashMessage')
|
|
<div class="card-header">
|
|
@include('crud-policies::crud.modules.breadcrumb', ['action' => CrudAction::view()])
|
|
@include('crud-policies::crud.modules.actionbar.bar', ['action' => CrudAction::view()])
|
|
</div>
|
|
<div class="card-body">
|
|
<table class="table table-sm table-bordered border-primary align-top table-striped text-center">
|
|
<thead class="thead-dark">
|
|
<tr>
|
|
<th scope="col" class="w-25">{{ __('crud-policies::crud.property') }}</th>
|
|
<th scope="col" class="w-75">{{ __('crud-policies::crud.value') }}</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
@foreach ($modelClass::getEditableProperties() as $fieldName => $prop)
|
|
@if(in_array(CrudAction::view(), $prop['actions']))
|
|
@switch($prop['type'])
|
|
@case(CrudType::password())
|
|
{{-- Ignore --}}
|
|
@break
|
|
@default
|
|
@if($fieldName === 'tasks')
|
|
<tr>
|
|
<td>{{ $prop['label'] }}</td>
|
|
<td>
|
|
@php $tasks = collect($model->{$fieldName}); @endphp
|
|
@if($tasks->count())
|
|
<div class="table-responsive">
|
|
<table class="table">
|
|
<thead>
|
|
<tr>
|
|
<th>{{ __('Commentaire') }}</th>
|
|
<th>{{ __('Type') }}</th>
|
|
<th>{{ __('Jours') }}</th>
|
|
<th>{{ __('Montant') }}</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
@foreach ($tasks as $task)
|
|
<tr>
|
|
<td>{{ $task['desc'] }}</td>
|
|
<td>
|
|
{{ App\Enums\Invoice\TaskType::make($task['type'])->label }}
|
|
@if($task['package'] ?? 0)
|
|
<br>
|
|
{{ optional($packages[$task['package']] ?? null)->name }}
|
|
@endif
|
|
</td>
|
|
<td>{{ number_format($task['days'], 2, ',', '') }}</td>
|
|
<td>{{ number_format($task['amount'], 2, ',', '') }} €</td>
|
|
</tr>
|
|
@endforeach
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
@else
|
|
<span class="h5">{{ __('Pas de tâches') }}</span>
|
|
@endif
|
|
</td>
|
|
</tr>
|
|
@else
|
|
<tr>
|
|
<td>{{ $prop['label'] }}</td>
|
|
<td>@include('crud-policies::crud.printfield', [
|
|
'action' => CrudAction::view(),
|
|
'field' => $model->{$fieldName},
|
|
'props' => $prop
|
|
])</td>
|
|
</tr>
|
|
@endif
|
|
@endswitch
|
|
@endif
|
|
@endforeach
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
@include('crud-policies::crud.modules.scriptConstants')
|
|
@endsection
|