@extends('layouts.admin') @section('title','Berita') @section('page_title','Berita & Publikasi') @section('page_subtitle','Berita MWCNU, Ranting, Banom dan Lembaga') @section('content')
<div class="grid form-grid"><section class="card"><h3>Tambah Berita</h3><form method="post" action="{{ route('news.store') }}" enctype="multipart/form-data" class="form">@csrf<div class="two"><label>Unit<select name="organization_id">@foreach($orgs as $o)<option value="{{ $o->id }}">{{ $o->acronym }}</option>@endforeach</select></label><label>Status<select name="status"><option value="draft">Draft</option><option value="review">Menunggu Review</option><option value="published">Terbit</option></select></label></div><label>Judul<input name="title" required></label><div class="two"><label>Kategori<input name="category" value="Kegiatan"></label><label>Foto Utama<input type="file" name="featured_image" accept="image/*"></label></div><label>Ringkasan<textarea name="excerpt" rows="2"></textarea></label><label>Isi Berita<textarea name="content" rows="7" required></textarea></label><button class="btn primary">Simpan Berita</button></form></section><section class="card tip"><h3>Optimasi Foto Otomatis</h3><p>Upload maksimal 10 MB. Bila ekstensi GD aktif, foto otomatis di-resize maksimal 1920 px dan dikonversi ke WebP kualitas 82%.</p><p>Berita unit dapat tampil di halaman slash unitnya sekaligus diagregasi ke portal utama <b>nutugu.org</b>.</p></section></div>
<section class="card table-card"><div class="section-head"><h3>Daftar Berita</h3><span>{{ $items->total() }} berita</span></div><div class="table-wrap"><table><thead><tr><th>Judul</th><th>Unit</th><th>Kategori</th><th>Status</th><th>Terbit</th><th>View</th></tr></thead><tbody>@foreach($items as $n)<tr><td><b>{{ $n->title }}</b><small>{{ $n->excerpt }}</small></td><td>{{ $n->organization?->acronym }}</td><td>{{ $n->category }}</td><td><span class="pill">{{ $n->status }}</span></td><td>{{ $n->published_at?->format('d M Y') ?? '—' }}</td><td>{{ $n->views }}</td></tr>@endforeach</tbody></table></div>{{ $items->links() }}</section>@endsection