@extends('layouts.admin') @section('title','Banom & Lembaga') @section('page_title','Banom & Lembaga') @section('page_subtitle','Aktifkan, nonaktifkan dan atur sinkronisasi ke portal MWCNU')
@section('content')
<div class="grid form-grid"><form class="card form" method="post" action="{{ route('units.store') }}">@csrf<h3>Tambah Banom / Lembaga</h3><div class="two"><label>Nama<input name="name" required placeholder="LP Ma'arif NU Kecamatan Tugu"></label><label>Singkatan<input name="acronym" placeholder="LP Ma'arif"></label></div><div class="three"><label>Jenis<select name="type"><option value="lembaga">Lembaga</option><option value="banom">Banom</option></select></label><label>Slug URL<input name="slug" placeholder="lpmaarif"></label><label>Warna<input name="theme_color" value="#0b6b45"></label></div><button class="btn primary">+ Tambah Unit</button></form><div class="card tip"><h3>URL otomatis</h3><p>Contoh: <b>nutugu.org/lpmaarif</b>. Tidak perlu membuat subdomain atau instalasi Laravel baru.</p></div></div>
<div class="unit-cards table-card">@foreach($units as $u)<div class="card unit-card"><div class="unit-logo">{{ substr($u->acronym ?: $u->name,0,2) }}</div><div><span class="pill">{{ strtoupper($u->type) }}</span><h3>{{ $u->name }}</h3><p>/{{ $u->slug }}</p><small>{{ $u->members()->count() }} pengurus • {{ $u->programs()->count() }} program • {{ $u->news()->count() }} berita</small></div><div><a class="btn" href="{{ route('public.unit',$u->slug) }}" target="_blank">Lihat ↗</a></div><form method="post" action="{{ route('units.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':'' }}> Unit 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':'' }}> Website 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 MWCNU</label><label><input type="hidden" name="aggregate_events" value="0"><input type="checkbox" name="aggregate_events" value="1" {{ $u->aggregate_events?'checked':'' }}> Kegiatan ke MWCNU</label><label><input type="hidden" name="aggregate_programs" value="0"><input type="checkbox" name="aggregate_programs" value="1" {{ $u->aggregate_programs?'checked':'' }}> Program ke statistik</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 counting</label></div><button class="btn primary" type="submit">Simpan Pengaturan</button></form></div>@endforeach</div>
@endsection
