{{-- resources/views/pages/groups/partials/post-rows.blade.php --}} @if($posts->count() > 0)
@foreach($posts as $post)
{{-- Post Type Icon --}} @if($post->type == 'discussion') @elseif($post->type == 'question') @else @endif {{-- Post Title with Link --}}
{{ $post->title }}
{{-- Status Badges --}} @if($post->trashed()) {{ __('labels.deleted') }} @elseif(!$post->is_approved) {{ __('labels.pending') }} @endif @if($post->is_locked) {{ __('labels.locked') }} @endif
{{-- Post Excerpt --}}

{{ Str::limit(strip_tags($post->content), 150) }}

{{-- Post Meta Info --}}
{{ $post->creator->name ?? __('labels.unknown') }} {{-- {{ $post->published_at?->format('M d, Y') ?? $post->created_at->format('M d, Y') }} --}} {{-- @if($post->published_at) {{ $post->published_at ? date('d.m.Y', strtotime($post->published_at)) : '' }} {{ $post->published_at ? date('H:i', strtotime($post->published_at)) : '' }} {{ __('labels.published') }} @else {{ __('labels.draft') }} @endif --}} @if($post->category) {{ $post->category->title }} @endif {{ $post->comments_count ?? 0 }} {{ __('labels.comments') }} {{ $post->like_count ?? 0 }}
{{-- Action Buttons --}}
@can('view', $post) @endcan @if($post->trashed()) @can('restore', $post) @endcan @else @can('update', $post) @endcan @can('delete', $post) @endcan @endif
@endforeach
@else
{{ __('messages.no_posts_found') }}
@can('create', App\Models\Post::class) {{ __('labels.create_first_post') }} @endcan
@endif