diff --git a/app/Http/Controllers/ProjectController.php b/app/Http/Controllers/ProjectController.php index 4feb02e..9966c8e 100644 --- a/app/Http/Controllers/ProjectController.php +++ b/app/Http/Controllers/ProjectController.php @@ -10,6 +10,7 @@ class ProjectController extends Controller { use CrudController { index as crudIndex; + show as crudShow; } /** @var Project */ @@ -26,4 +27,11 @@ class ProjectController extends Controller } return view('projects.index', $view->getData()); } + + public function show(Project $model) + { + /** @var \Illuminate\View\View */ + $view = $this->crudshow($model); + return view('projects.show', $view->getData()); + } } diff --git a/app/Policies/LogPolicy.php b/app/Policies/LogPolicy.php index 1917b41..becb137 100644 --- a/app/Policies/LogPolicy.php +++ b/app/Policies/LogPolicy.php @@ -31,7 +31,7 @@ class LogPolicy extends RootPolicy 'log' => [ 'viewAny' => URR::make('userIsAdmin', $user), 'view' => URR::make('denyEveryOne'), - 'update' => StaticRules::or([ + 'update' => StaticRules::and([ URR::make('userIsDev', $user), LogStaticRules::make('logIsOwnedByUser', $user, $model) ]), diff --git a/resources/views/logs/index.blade.php b/resources/views/logs/index.blade.php index 0e98900..1bb533f 100644 --- a/resources/views/logs/index.blade.php +++ b/resources/views/logs/index.blade.php @@ -51,8 +51,11 @@
-
- {{ $model->created_at }} +
+ + {{ $model->created_at }} + +  {{ $model->user->name }} $ 
@can('view', $model) @@ -71,10 +74,7 @@
-
{{ __('Par :username', [ - 'username' => $model->user->name - ])}}
-
{{ $model->entry }}
+
{!! $model->entry !!}
diff --git a/resources/views/projects/show.blade.php b/resources/views/projects/show.blade.php new file mode 100644 index 0000000..fb01815 --- /dev/null +++ b/resources/views/projects/show.blade.php @@ -0,0 +1,53 @@ +@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') +
+ @include('crud-policies::crud.modules.flashMessage') +
+ @include('crud-policies::crud.modules.breadcrumb', ['action' => CrudAction::view()]) + @include('crud-policies::crud.modules.actionbar.bar', ['action' => CrudAction::view()]) +
+
+ + + + + + + + + @foreach ($modelClass::getEditableProperties() as $fieldName => $prop) + @if(in_array(CrudAction::view(), $prop['actions'])) + @switch($prop['type']) + @case(CrudType::password()) + {{-- Ignore --}} + @break + @default + + + @switch($fieldName) + @case('description') + @case('todo') + + @break + @default + + @endswitch + + @endswitch + @endif + @endforeach + +
{{ __('crud-policies::crud.property') }}{{ __('crud-policies::crud.value') }}
{{ $prop['label'] }}{!! $model->{$fieldName} !!}@include('crud-policies::crud.printfield', [ + 'action' => CrudAction::view(), + 'field' => $model->{$fieldName}, + 'props' => $prop + ])
+
+
+@include('crud-policies::crud.modules.scriptConstants') +@endsection