@extends('layouts.admin') @section('title', $article->exists ? 'Edit article' : ($source ? 'Translate article' : 'New article')) @section('content') @php $v = fn ($k, $d = null) => old($k, $article->{$k} ?? $source?->{$k} ?? $d); $cropIds = collect(old('crop_ids', $article->exists ? $article->crops->pluck('id') : ($source?->crops->pluck('id') ?? [])))->map(fn ($i) => (int) $i); $topicIds = collect(old('topic_ids', $article->exists ? $article->categories->pluck('id') : ($source?->categories->pluck('id') ?? [])))->map(fn ($i) => (int) $i); @endphp @if ($article->exists)
@include('partials.status', ['status' => $article->status_id]) {{ $article->published_at ? 'Published '.ist($article->published_at) : 'Not published' }}
@include('partials.actions', ['actions' => $actions, 'route' => route('admin.articles.status', $article), 'id' => 'art'])
@endif @if ($source)
Translating {{ $source->title }}. Write the text in the new language; crops and topics are copied over.
@endif
@csrf @if ($article->exists) @method('PUT') @endif @if ($source)@endif
## Heading · - bullet · [ ] checklist item (shown as "Take this to your field") · > reminder (local-conditions note) · blank line between paragraphs.
@if ($article->exists && $article->body_blocks)
Preview
@foreach ($article->body_blocks as $b) @switch($b['type']) @case('heading')

{{ $b['text'] }}

@break @case('bullets')
    @foreach ($b['items'] as $i)
  • {{ $i }}
  • @endforeach
@break @case('checklist')
Take this to your field
    @foreach ($b['items'] as $i)
  • {{ $i }}
  • @endforeach
@break @case('reminder')

{{ $b['text'] }}

@break @default

{{ $b['text'] }}

@endswitch @endforeach
@endif
First selected is the main crop. None = all crops.
is_featured))>
Media
@if ($article->cover)
@endif
@if ($article->exists) Add another language @endif
@if ($translations->isNotEmpty())
Other languages
@endif @if ($article->exists)@include('partials.history', ['history' => $history])@endif
@if ($article->exists)
@csrf @method('DELETE')
@endif @endsection