{{-- resources/views/groups/form.blade.php --}} @extends('layouts.app') @section('css') @endsection @section('js') @endsection @push('pageTitle') {{ isset($post) && isset($readonly) && $readonly ? __('labels.view_post') : (isset($post) ? __('labels.edit_post') : __('labels.create_post')) }} @endpush @section('content') @include('components.common.page-header', [ 'pageTitle' => isset($post) && isset($readonly) && $readonly ? __('labels.view_post') : (isset($post) ? __('labels.edit_post') : __('labels.create_post')), 'actionButton' => [ 'url' => isset($selectedGroupId) ? route('groups.show', ['group' => $selectedGroupId]) : route('posts.index'), 'text' => isset($selectedGroupId) ? __('labels.back_to_group') : __('labels.back_to_posts'), ], ]) @include('components.common.flush-message') @include('components.common.validation-errors') @include('components.form.add-category-modal')
@csrf @if(isset($post)) @method('PUT') @endif {{-- Custom Author Name --}}
{{-- Title --}}
@error('title')
{{ $message }}
@enderror
{{-- Description --}}
@error('description')
{{ $message }}
@enderror
@include('components.form.author-name', [ 'readonly' => isset($readonly) && $readonly ? 1 : 0, 'authorName' => old('author_name', isset($post->author_name) && $post->author_name ? $post->author_name : auth()->user()->name), ])
@error('type')
{{ $message }}
@enderror
{{-- Category with Add Button --}}
@if(!isset($readonly) || (isset($readonly) && !$readonly)) @can('create', \App\Models\PostCategory::class) @endcan @endif
@error('category_id')
{{ $message }}
@enderror @can('create', \App\Models\PostCategory::class) {{ __('labels.select_or_create_category') }} @endcan
@include('components.form.published-inputs', [ 'readonly' => isset($readonly) && $readonly ? 1 : 0, 'published_at' => old('published_at', $post->published_at ?? ''), 'is_published' => old('is_published', $post->is_published ?? ''), ])
@if(isset($post->assets) && count($post->assets)) @include('components.form.file-manager.existing-files',[ 'readonly' => isset($readonly) && $readonly ? 1 : 0, 'assets' => $post->assets ]) @endif @if(!isset($readonly) || (isset($readonly) && !$readonly)) @include('components.form.file-manager.upload-files') @endif {{-- @include('components.form.select-group',[ 'readonly' => isset($readonly) && $readonly ? 1 : 0, 'groups' => $groups ?? [], 'selectedGroups' => old('groups', isset($selectedGroups) && count($selectedGroups) ? $selectedGroups : null), 'canCreate' => auth()->user()->can('create',\App\Models\Post::class), 'canUpdate' => isset($post) && auth()->user()->can('update',$post), ]) --}} @if(!isset($readonly) || (isset($readonly) && !$readonly))
{{ __('labels.cancel') }}
@endif {{-- @if(isset($post)) @include('components.comments.index', [ 'comments' => $post->comments ?? null, 'commentStates' => \App\Models\Comment::commentStates($post), 'commentableId' => $post->id ?? null, 'commentableType' => 'App\Models\Post', ]) @endif --}} @endsection