@extends('layouts.admin') @section('title','Ranting') @section('page_title','Ranting NU') @section('page_subtitle','Jumlah Ranting dinamis: dapat ditambah, dinonaktifkan dan diarsipkan')
@section('content')
<div class="grid form-grid"><form class="card form" method="post" action="{{ route('rantings.store') }}">@csrf<h3>Tambah Ranting</h3><div class="two"><label>Nama Ranting<input name="name" required placeholder="PRNU Tugurejo"></label><label>Singkatan<input name="acronym" placeholder="PRNU Tugurejo"></label></div><div class="two"><label>Slug<input name="slug" placeholder="tugurejo"></label><label>Alamat<input name="address"></label></div><button class="btn primary">+ Tambah Ranting</button></form><div class="card tip"><h3>Fleksibel</h3><p>MWCNU dapat memiliki 0, 3, 10, atau puluhan Ranting. URL publik: <b>nutugu.org/ranting/nama-ranting</b>.</p></div></div>
<div class="unit-cards table-card">@forelse($rantings as $u)<div class="card unit-card"><div class="unit-logo">PR</div><div><span class="pill">RANTING</span><h3>{{ $u->name }}</h3><p>/ranting/{{ $u->slug }}</p><small>{{ $u->members()->count() }} pengurus • {{ $u->news()->count() }} berita</small></div><a class="btn" href="{{ route('public.ranting',$u->slug) }}" target="_blank">Lihat ↗</a><form method="post" action="{{ route('rantings.update',$u) }}" style="grid-column:1/-1">@csrf @method('PATCH')<div class="toggle-grid"><label><input type="hidden" name="is_active" value="0"><input type="checkbox" name="is_active" value="1" {{ $u->is_active?'checked':'' }}> Aktif</label><label><input type="hidden" name="public_page_enabled" value="0"><input type="checkbox" name="public_page_enabled" value="1" {{ $u->public_page_enabled?'checked':'' }}> Halaman publik</label><label><input type="hidden" name="aggregate_news" value="0"><input type="checkbox" name="aggregate_news" value="1" {{ $u->aggregate_news?'checked':'' }}> Berita ke portal</label><label><input type="hidden" name="aggregate_events" value="0"><input type="checkbox" name="aggregate_events" value="1" {{ $u->aggregate_events?'checked':'' }}> Kegiatan ke portal</label><label><input type="hidden" name="include_in_statistics" value="0"><input type="checkbox" name="include_in_statistics" value="1" {{ $u->include_in_statistics?'checked':'' }}> Ikut statistik</label></div><button class="btn primary">Simpan</button></form></div>@empty<div class="card empty">Belum ada Ranting. Sistem tetap dapat digunakan tanpa Ranting.</div>@endforelse</div>
@endsection
