diff --git a/.github/ISSUE_TEMPLATE/permintaan-fitur.md b/.github/ISSUE_TEMPLATE/permintaan-fitur.md index 818f6bd73..67cec64c3 100644 --- a/.github/ISSUE_TEMPLATE/permintaan-fitur.md +++ b/.github/ISSUE_TEMPLATE/permintaan-fitur.md @@ -2,7 +2,7 @@ name: Permintaan fitur about: Mengusulkan perbaikan fitur atau fitur baru title: '' -labels: permintaan fitur +labels: fitur assignees: '' --- diff --git a/.gitignore b/.gitignore index 96c643ec8..50e482fd8 100644 --- a/.gitignore +++ b/.gitignore @@ -25,3 +25,7 @@ composer.lock .php-cs-fixer.cache .phpcs-cache /.vscode + +# Themes +/themes/* +!/themes/opendk/default/ \ No newline at end of file diff --git a/app/Enums/Anonim.php b/app/Enums/Anonim.php new file mode 100644 index 000000000..91affe1c7 --- /dev/null +++ b/app/Enums/Anonim.php @@ -0,0 +1,43 @@ + 'Profil', + self::DESA => 'Desa', + self::STATISTIK => 'Statistik', + self::POTENSI => 'Potensi', + self::UNDUHAN => 'Unduhan', + self::EKSTERNAL => 'Eksternal', + ]; + } + + public static function getProfil(): array + { + return [ + 'sejarah' => 'Sejarah', + 'visi-dan-misi' => 'Visi dan Misi', + 'letak-geografis' => 'Letak Geografis', + 'struktur-pemerintahan' => 'Struktur Pemerintahan', + 'sambutan' => 'Sambutan' + ]; + } + + public static function getDesa(): array + { + return DataDesa::get()->pluck('nama', 'sebutan_desa')->toArray(); + } + + public static function getPotensi(): array + { + return TipePotensi::get()->pluck('nama_kategori', 'slug')->toArray(); + } + + public static function getStatistik(): array + { + return [ + 'kependudukan' => 'Kependudukan', + 'pendidikan' => 'Pendidikan', + 'kesehatan' => 'Kesehatan', + 'program-dan-bantuan' => 'Program dan Bantuan', + 'anggaran-dan-realisasi' => 'Anggaran dan Realisasi', + 'anggaran-desa' => 'Anggaran Desa', + ]; + } + + public static function getUnduhan(): array + { + return [ + 'peraturan' => 'Peraturan', + 'formulir' => 'Formulir', + 'laporan' => 'Laporan', + 'dokumen' => 'Dokumen', + ]; + } +} diff --git a/app/Enums/Tema.php b/app/Enums/Tema.php new file mode 100644 index 000000000..8b969163b --- /dev/null +++ b/app/Enums/Tema.php @@ -0,0 +1,43 @@ +addColumn('aksi', function ($row) { + $data['anonim'] = route('admin-komplain.anonim', $row->id); $data['agree_url'] = route('admin-komplain.setuju', $row->id); $data['show_url'] = route('admin-komplain.show', $row->id); $data['delete_url'] = route('admin-komplain.destroy', $row->id); @@ -90,7 +92,18 @@ public function getDataKomplain() return $status; }) - ->rawColumns(['aksi', 'status'])->make(); + ->editColumn('anonim', function ($row) { + $anonim = ''; + if ($row->anonim == Anonim::Tampilkan) { + $anonim = 'Ditampilkan'; + } + if ($row->anonim == Anonim::Sembunyikan) { + $anonim = 'Disembunyikan'; + } + + return $anonim; + }) + ->rawColumns(['aksi', 'status', 'anonim'])->make(); } public function disetujui(Request $request, $id) @@ -110,6 +123,23 @@ public function disetujui(Request $request, $id) return redirect()->route('admin-komplain.index')->with('success', 'Status Keluhan berhasil disimpan!'); } + public function anonim(Request $request, $id) + { + request()->validate([ + 'anonim' => 'required', + ]); + + try { + Komplain::findOrFail($id)->update($request->all()); + } catch (\Exception $e) { + report($e); + + return back()->withInput()->with('error', 'Identitas Pelapor Keluhan gagal diperbarui!'); + } + + return redirect()->route('admin-komplain.index')->with('success', 'Identitas Pelapor Keluhan berhasil diperbarui!'); + } + public function show($id) { $komplain = Komplain::findOrFail($id); @@ -117,7 +147,7 @@ public function show($id) $page_description = 'Detail Keluhan : '.$komplain->judul; $penduduk = Penduduk::where('nik', $komplain->nik)->first(); - return view('sistem_komplain.admin_komplain.show', compact('page_title', 'page_description', 'komplain', 'penduduk')); + return view('sistem_komplain.show', compact('page_title', 'page_description', 'komplain', 'penduduk')); } /** @@ -132,7 +162,7 @@ public function edit($id) $page_title = 'Keluhan'; $page_description = 'Ubah Keluhan'.$komplain->komplain_id; - return view('sistem_komplain.admin_komplain.edit', compact('page_title', 'page_description', 'komplain')); + return view('sistem_komplain.edit', compact('page_title', 'page_description', 'komplain')); } /** @@ -228,7 +258,7 @@ public function statistik() $chart_status = $this->getChartStatus(); $chart_desa = $this->getChartDesa(); - return view('sistem_komplain.admin_komplain.statistik', compact('page_title', 'page_description', 'chart_kategori', 'chart_status', 'chart_desa')); + return view('sistem_komplain.statistik', compact('page_title', 'page_description', 'chart_kategori', 'chart_status', 'chart_desa')); } protected function getChartKategori() diff --git a/app/Http/Controllers/FrontEnd/PageController.php b/app/Http/Controllers/FrontEnd/PageController.php index 7ff16fa3b..6de427409 100644 --- a/app/Http/Controllers/FrontEnd/PageController.php +++ b/app/Http/Controllers/FrontEnd/PageController.php @@ -72,32 +72,7 @@ public function beritaDesa() private function getFeeds() { - $all_desa = DataDesa::websiteUrl()->get() - ->map(function ($desa) { - return $desa->website_url_feed; - })->all(); - - $feeds = []; - foreach ($all_desa as $desa) { - $getFeeds = FeedsFacade::make($desa['website'], 5, true); - foreach ($getFeeds->get_items() as $item) { - $feeds[] = [ - 'desa_id' => $desa['desa_id'], - 'nama_desa' => $desa['nama'], - 'feed_link' => $item->get_feed()->get_permalink(), - 'feed_title' => $item->get_feed()->get_title(), - 'link' => $item->get_link(), - 'date' => \Carbon\Carbon::parse($item->get_date('U')), - 'author' => $item->get_author()->get_name() ?? 'Administrator', - 'title' => $item->get_title(), - 'image' => get_tag_image($item->get_description()), - 'description' => strip_tags(substr(str_replace(['&', 'nbsp;', '[...]'], '', $item->get_description()), 0, 250).'[...]'), - 'content' => $item->get_content(), - ]; - } - } - - return $feeds ?? null; + return getFeeds(); } public function filterFeeds(Request $request) diff --git a/app/Http/Controllers/FrontEnd/PendidikanController.php b/app/Http/Controllers/FrontEnd/PendidikanController.php index f5df7969f..214c385ac 100644 --- a/app/Http/Controllers/FrontEnd/PendidikanController.php +++ b/app/Http/Controllers/FrontEnd/PendidikanController.php @@ -106,7 +106,7 @@ public function getChartTingkatPendidikan() foreach (semester() as $key => $value) { $query_pendidikan = DB::table('das_tingkat_pendidikan') ->selectRaw('sum(tidak_tamat_sekolah) as tidak_tamat_sekolah, sum(tamat_sd) as tamat_sd, sum(tamat_smp) as tamat_smp, sum(tamat_sma) as tamat_sma, sum(tamat_diploma_sederajat) as tamat_diploma_sederajat') - ->whereRaw('bulan in ('.$this->getIdsSemester($key).')') + // ->whereRaw('bulan in ('.$this->getIdsSemester($key).')') ->where('tahun', $year) ->where('desa_id', '=', $did) ->get()->first(); @@ -219,7 +219,7 @@ public function getChartPutusSekolah() // Quartal foreach (semester() as $key => $kuartal) { $query_pendidikan = DB::table('das_putus_sekolah') - ->whereRaw('bulan in ('.$this->getIdsSemester($key).')') + // ->whereRaw('bulan in ('.$this->getIdsSemester($key).')') ->where('tahun', $year) ->where('desa_id', '=', $did); diff --git a/app/Http/Controllers/FrontEnd/ProfilController.php b/app/Http/Controllers/FrontEnd/ProfilController.php index 9d9ce252e..22edfd276 100644 --- a/app/Http/Controllers/FrontEnd/ProfilController.php +++ b/app/Http/Controllers/FrontEnd/ProfilController.php @@ -138,4 +138,17 @@ public function showProfile() return view('pages.profil.show_profil', compact('page_title', 'page_description', 'profil', 'dokumen')); } + + public function Sambutan() + { + Counter::count('profil.sambutan'); + + $profil = $this->profil; + $page_title = 'Sambutan'; + if (isset($profil)) { + $page_description = $this->browser_title; + } + + return view('pages.profil.sambutan', compact('page_title', 'page_description', 'profil')); + } } diff --git a/app/Http/Controllers/SistemKomplain/SistemKomplainController.php b/app/Http/Controllers/FrontEnd/SistemKomplainController.php similarity index 92% rename from app/Http/Controllers/SistemKomplain/SistemKomplainController.php rename to app/Http/Controllers/FrontEnd/SistemKomplainController.php index f05c251f0..003782101 100644 --- a/app/Http/Controllers/SistemKomplain/SistemKomplainController.php +++ b/app/Http/Controllers/FrontEnd/SistemKomplainController.php @@ -29,17 +29,17 @@ * @link https://github.com/OpenSID/opendk */ -namespace App\Http\Controllers\SistemKomplain; +namespace App\Http\Controllers\FrontEnd; -use App\Http\Controllers\Controller; -use App\Models\JawabKomplain; use App\Models\Komplain; use App\Models\Penduduk; use Illuminate\Http\Request; +use App\Models\JawabKomplain; use Illuminate\Http\Response; use Illuminate\Support\Facades\Validator; +use App\Http\Controllers\FrontEndController; -class SistemKomplainController extends Controller +class SistemKomplainController extends FrontEndController { public function index() { @@ -51,7 +51,7 @@ public function index() ->where('status', '<>', 'REVIEW') ->orderBy('created_at', 'desc')->paginate(10); - return view('sistem_komplain.komplain.index', compact('page_title', 'page_description', 'komplains')); + return view('pages.komplain.index', compact('page_title', 'page_description', 'komplains')); } // TODO : Cek digunakan dimana ? @@ -61,7 +61,7 @@ public function indexKategori($slug) $page_description = 'Sistem Keluhan Masyarakat'; $komplains = Komplain::where('kategori', '=', $slug)->orderBy('created_at', 'desc')->paginate(10); - return view('sistem_komplain.komplain.index', compact('page_title', 'page_description', 'komplains')); + return view('pages.komplain.index', compact('page_title', 'page_description', 'komplains')); } // TODO : Cek digunakan dimana ? @@ -71,7 +71,7 @@ public function indexSukses() $page_description = 'Sistem Keluhan Masyarakat'; $komplains = Komplain::where('status', '=', 'Selesai')->orderBy('created_at', 'desc')->paginate(10); - return view('sistem_komplain.komplain.index', compact('page_title', 'page_description', 'komplains')); + return view('pages.komplain.index', compact('page_title', 'page_description', 'komplains')); } public function kirim() @@ -79,7 +79,7 @@ public function kirim() $page_title = 'Kirim Keluhan'; $page_description = 'Kirim Keluhan Baru'; - return view('sistem_komplain.komplain.kirim', compact('page_title', 'page_description')); + return view('pages.komplain.kirim', compact('page_title', 'page_description')); } public function tracking(Request $request) @@ -202,7 +202,7 @@ public function show($slug) $page_title = 'Laporan'; $page_description = 'Detail Laporan : '.$komplain->judul; - return view('sistem_komplain.komplain.show', compact('page_title', 'page_description', 'komplain')); + return view('pages.komplain.show', compact('page_title', 'page_description', 'komplain')); } public function reply(Request $request, $id) @@ -260,6 +260,6 @@ public function getJawabans(Request $request) $jawabans = JawabKomplain::where('komplain_id', $request->input('id'))->orderBy('id', 'desc')->get(); $komplain = Komplain::where('komplain_id', $request->input('id'))->get()[0]; - return view('sistem_komplain.komplain.jawabans', compact('jawabans', 'komplain'))->render(); + return view('pages.komplain.jawabans', compact('jawabans', 'komplain'))->render(); } } diff --git a/app/Http/Controllers/Setting/AplikasiController.php b/app/Http/Controllers/Setting/AplikasiController.php index 31ab20ab4..ff92a3657 100644 --- a/app/Http/Controllers/Setting/AplikasiController.php +++ b/app/Http/Controllers/Setting/AplikasiController.php @@ -39,21 +39,9 @@ class AplikasiController extends Controller { public function index() { - $settings = SettingAplikasi::where('kategori', '!=', 'surat')->get(); - if ($settings->isEmpty()) { - SettingAplikasi::insert([ - 'key' => SettingAplikasi::KEY_BROWSER_TITLE, - 'value' => $this->browser_title, - 'type' => 'input', - 'description' => 'Judul halaman aplikasi.', - 'kategori' => '-', - 'option' => '{}', - ]); - $settings = SettingAplikasi::all(); - } - $page_title = 'Pegaturan Aplikasi'; $page_description = 'Daftar Pegaturan Aplikasi'; + $settings = SettingAplikasi::where('kategori', '!=', 'surat')->get(); return view('setting.aplikasi.index', compact('page_title', 'page_description', 'settings')); } diff --git a/app/Http/Controllers/Setting/NavigationController.php b/app/Http/Controllers/Setting/NavigationController.php index c611b854d..ba7d77170 100644 --- a/app/Http/Controllers/Setting/NavigationController.php +++ b/app/Http/Controllers/Setting/NavigationController.php @@ -31,7 +31,6 @@ namespace App\Http\Controllers\Setting; - use App\Http\Controllers\Controller; use App\Http\Requests\NavigationRequest; use App\Models\Navigation; @@ -92,8 +91,9 @@ public function create($parent_id = 0) { $page_title = 'Navigasi'; $page_description = 'Tambah Navigasi'; + $navigation = null; - return view('setting.navigation.create', compact('page_title', 'page_description', 'parent_id')); + return view('setting.navigation.create', compact('page_title', 'page_description', 'parent_id', 'navigation')); } /** @@ -110,7 +110,7 @@ public function store(NavigationRequest $request) $data = $request->all(); // generate slug - $parent = Navigation::where('id', $parent_id)->first(); + $parent = Navigation::where('id', $parent_id)->first(); $data['slug'] = (!empty($parent)) ? $parent->slug . "-" . Str::slug($data['name']) : Str::slug($data['name']); // set latest order diff --git a/app/Http/Controllers/Setting/SlideController.php b/app/Http/Controllers/Setting/SlideController.php index 91d61ed51..25bcdff82 100644 --- a/app/Http/Controllers/Setting/SlideController.php +++ b/app/Http/Controllers/Setting/SlideController.php @@ -76,11 +76,9 @@ public function store(SlideRequest $request) if ($request->hasFile('gambar')) { $file = $request->file('gambar'); - $fileName = $file->getClientOriginalName(); - $path = 'storage/slide/'; - $file->move($path, $fileName); - - $input['gambar'] = $path.$fileName; + $fileName = $file->hashName(); + $path = $file->storeAs('public/slide', $fileName); + $input['gambar'] = str_replace('public/', 'storage/', $path); } Slide::create($input); } catch (\Exception $e) { @@ -94,7 +92,7 @@ public function store(SlideRequest $request) public function show(Slide $slide) { - $page_title = 'Detail Slide :'.$slide->judul; + $page_title = 'Detail Slide :' . $slide->judul; return view('setting.slide.show', compact('page_title', 'page_description', 'slide')); } @@ -102,7 +100,7 @@ public function show(Slide $slide) public function edit(Slide $slide) { $page_title = 'Slide'; - $page_description = 'Ubah Slide : '.$slide->judul; + $page_description = 'Ubah Slide : ' . $slide->judul; return view('setting.slide.edit', compact('page_title', 'page_description', 'slide')); } @@ -114,12 +112,9 @@ public function update(SlideRequest $request, Slide $slide) if ($request->hasFile('gambar')) { $file = $request->file('gambar'); - $fileName = $file->getClientOriginalName(); - $path = 'storage/slide/'; - $file->move($path, $fileName); - unlink(base_path('public/'.$slide->gambar)); - - $input['gambar'] = $path.$fileName; + $fileName = $file->hashName(); + $path = $file->storeAs('public/slide', $fileName); + $input['gambar'] = str_replace('public/', 'storage/', $path); } $slide->update($input); } catch (\Exception $e) { @@ -134,9 +129,7 @@ public function update(SlideRequest $request, Slide $slide) public function destroy(Slide $slide) { try { - if ($slide->delete()) { - unlink(base_path('public/'.$slide->gambar)); - } + $slide->delete(); } catch (\Exception $e) { report($e); diff --git a/app/Http/Requests/NavigationRequest.php b/app/Http/Requests/NavigationRequest.php index 49633b99a..a1ff766fb 100644 --- a/app/Http/Requests/NavigationRequest.php +++ b/app/Http/Requests/NavigationRequest.php @@ -54,7 +54,7 @@ public function rules() { return [ 'name' => 'required', - 'nav_type' => 'required', + 'type' => 'required', 'url' => 'required', ]; } diff --git a/app/Models/Komplain.php b/app/Models/Komplain.php index a91e79794..96f7e0d9e 100644 --- a/app/Models/Komplain.php +++ b/app/Models/Komplain.php @@ -44,12 +44,12 @@ class Komplain extends Model 'judul', 'slug', 'laporan', - 'anonim', 'status', 'lampiran1', 'lampiran2', 'lampiran3', 'lampiran4', + 'anonim', ]; protected $with = ['penduduk']; diff --git a/app/Models/Navigation.php b/app/Models/Navigation.php index 0099b8dca..2df52ab77 100644 --- a/app/Models/Navigation.php +++ b/app/Models/Navigation.php @@ -31,9 +31,11 @@ namespace App\Models; -use Illuminate\Database\Eloquent\Factories\HasFactory; -use Cviebrock\EloquentSluggable\Sluggable; +use App\Enums\MenuTipe; +use Illuminate\Support\Facades\Log; use Illuminate\Database\Eloquent\Model; +use Cviebrock\EloquentSluggable\Sluggable; +use Illuminate\Database\Eloquent\Factories\HasFactory; class Navigation extends Model { @@ -46,7 +48,11 @@ class Navigation extends Model /** * {@inheritDoc} */ - protected $fillable = ['name', 'slug', 'parent_id', 'nav_type', 'url', 'order', 'status']; + protected $fillable = ['name', 'slug', 'parent_id', 'type', 'url', 'order', 'status']; + + protected $appends = [ + 'full_url', + ]; /** * Return user's query for Datatables. @@ -55,7 +61,7 @@ class Navigation extends Model */ public static function datatables() { - return static::select('name', 'slug', 'parent_id', 'nav_type', 'url', 'order', 'id', 'status')->get(); + return static::select('name', 'slug', 'parent_id', 'type', 'url', 'order', 'id', 'status')->get(); } public static function lastOrder($parent_id = 0) @@ -72,4 +78,42 @@ public function childrens() { return $this->hasMany(Navigation::class, 'parent_id'); } + + public function setParentIdAttribute($value) + { + $this->attributes['parent_id'] = $value == 0 ? null : $value; + } + + public function setNavTypeAttribute($value) + { + $this->attributes['nav_type'] = 'system'; + } + + public function setUrlAttribute($value) + { + if ($this->type != MenuTipe::EKSTERNAL) { + $this->attributes['url'] = str_replace(url('/') . '/', '', $value); + } else { + $this->attributes['url'] = $value; + } + } + + public function getFullUrlAttribute() + { + switch ($this->type) { + case MenuTipe::PROFIL: + case MenuTipe::DESA: + case MenuTipe::STATISTIK: + case MenuTipe::POTENSI: + case MenuTipe::UNDUHAN: + return url($this->url); + break; + case MenuTipe::EKSTERNAL: + return $this->url; + break; + default: + return '#'; + break; + } + } } diff --git a/app/Models/Profil.php b/app/Models/Profil.php index 35cdf5977..f84a27164 100644 --- a/app/Models/Profil.php +++ b/app/Models/Profil.php @@ -56,15 +56,10 @@ class Profil extends Model 'file_struktur_organisasi', 'file_logo', 'sambutan', - 'socialmedia', 'visi', 'misi', ]; - protected $cast = [ - 'socialmedia' => 'array', - ]; - public static function getProfilTanpaDataUmum() { $data_umums = DataUmum::get(); diff --git a/app/Models/Slide.php b/app/Models/Slide.php index 491d28a42..134056752 100644 --- a/app/Models/Slide.php +++ b/app/Models/Slide.php @@ -31,6 +31,7 @@ namespace App\Models; +use Illuminate\Support\Facades\Log; use Illuminate\Database\Eloquent\Model; class Slide extends Model @@ -42,4 +43,25 @@ class Slide extends Model 'judul', 'deskripsi', ]; + + public static function booted() + { + static::updating(function ($model) { + static::deleteImg($model); + }); + + static::deleting(function ($model) { + static::deleteImg($model, true); + }); + } + + protected static function deleteImg($model, $deleting = false) + { + if ($model->isDirty('gambar') || $deleting) { + $slidePath = public_path($model->getOriginal('gambar')); + if (file_exists($slidePath)) { + unlink($slidePath); + } + } + } } diff --git a/catatan_rilis.md b/catatan_rilis.md index c9f08bd71..0431ad190 100644 --- a/catatan_rilis.md +++ b/catatan_rilis.md @@ -1,17 +1,28 @@ -Di rilis versi v2408.0.1 di versi ini terdapat modul navigasi halaman publik dan perbaikan lain yang diminta Komunitas. +Di rilis versi v2409.0.0 di versi ini terdapat modul navigasi halaman publik dan perbaikan lain yang diminta Komunitas. Terima kasih pada @uddinmtm telah ikut berkontribusi. #### FITUR -1. [#511](https://github.com/OpenSID/OpenDK/issues/511) Penambahan modul navigasi halaman publik. +1. [#998](https://github.com/OpenSID/OpenDK/issues/998) Penambahan sambutan pada daftar menu navigasi. +2. [#669](https://github.com/OpenSID/OpenDK/issues/669) Penambahan identitas pelapor. #### BUG - -1. [#932](https://github.com/OpenSID/OpenDK/issues/932) Sesuaikan tombol batal dan kembali. +1. [#980](https://github.com/OpenSID/OpenDK/issues/980) Hapus media sosial pada profile +2. [#1002](https://github.com/OpenSID/OpenDK/issues/1002) Fix Error Statistik Pendidikan +3. [#1008](https://github.com/OpenSID/OpenDK/issues/1008) Perbaikan error tidak bisa mengirim keluhan di sikema. +4. [#985](https://github.com/OpenSID/OpenDK/issues/985) Perbaikan navigasi default +5. [#990](https://github.com/OpenSID/OpenDK/issues/990) Perbaikan error ketika hapus slide tanpa gambar +6. [#994](https://github.com/OpenSID/OpenDK/issues/994) Perbaikan error migrasi tema. +7. [#992](https://github.com/OpenSID/OpenDK/issues/992) Perbaikan error setelah update terbaru. +8. [#993](https://github.com/OpenSID/OpenDK/issues/993) Perbaikan penduduk nik ganda. #### TEKNIS -1. [#982](https://github.com/OpenSID/OpenDK/issues/982) Perbaikan celah di API list penduduk dan kk. \ No newline at end of file +1. [#982](https://github.com/OpenSID/OpenDK/issues/982) Perbaikan celah di API list penduduk dan kk. +2. [#1006](https://github.com/OpenSID/OpenDK/issues/1006) Template Issue Label Fitur +3. [#988](https://github.com/OpenSID/OpenDK/pull/988) Hapus pengecekan settings kosong +4. [#1004](https://github.com/OpenSID/OpenDK/issues/1004) Gunakan cache untuk mempercepat pengambilan data feeds berita desa +5. [#1000](https://github.com/OpenSID/OpenDK/issues/1000) Pindahkan halaman frontend ke folder themes \ No newline at end of file diff --git a/config/app.php b/config/app.php index f6f66f20d..6c45b3aaf 100644 --- a/config/app.php +++ b/config/app.php @@ -39,7 +39,7 @@ |-------------------------------------------------------------------------- */ - 'version' => 'v2408.0.0', + 'version' => 'v2409.0.0', /* |-------------------------------------------------------------------------- diff --git a/database/migrations/2024_06_03_042202_create_themes.php b/database/migrations/2024_06_03_042202_create_themes.php index df4b81ded..ba9711b2d 100644 --- a/database/migrations/2024_06_03_042202_create_themes.php +++ b/database/migrations/2024_06_03_042202_create_themes.php @@ -1,8 +1,12 @@ id(); - $table->string('name'); - $table->string('vendor'); - $table->string('version'); - $table->string('description')->nullable(); - $table->string('path'); - $table->string('screenshot')->nullable(); - $table->boolean('active')->default(0); - $table->boolean('system')->default(0); - $table->mediumText('options')->nullable(); - $table->timestamps(); - }); + // cek apakah tabel das_themes ada + if (Schema::hasTable('das_themes')) { + // Kosongkan tabel + DB::table('das_themes')->truncate(); + } else { + Schema::create('das_themes', function (Blueprint $table) { + $table->id(); + $table->string('name'); + $table->string('vendor'); + $table->string('version'); + $table->string('description')->nullable(); + $table->string('path'); + $table->string('screenshot')->nullable(); + $table->boolean('active')->default(Status::TidakAktif); + $table->boolean('system')->default(Tema::TemaKostum); + $table->mediumText('options')->nullable(); + $table->timestamps(); + }); + } - scan_themes(); + try { + scan_themes(); + } catch (\Exception $e) { + Log::error('Error scanning themes: ' . $e->getMessage()); + } } /** diff --git a/database/migrations/2024_07_01_101314_create_navigations_table.php b/database/migrations/2024_07_01_101314_create_navigations_table.php index 19c39380a..71b931f59 100644 --- a/database/migrations/2024_07_01_101314_create_navigations_table.php +++ b/database/migrations/2024_07_01_101314_create_navigations_table.php @@ -28,7 +28,6 @@ * @license http://www.gnu.org/licenses/gpl.html GPL V3 * @ */ - use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Artisan; @@ -42,7 +41,8 @@ * @return void */ public function up() - { +{ + if (!Schema::hasTable('das_navigation')) { Schema::create('das_navigation', function (Blueprint $table) { $table->increments('id'); $table->integer('parent_id')->nullable(); @@ -52,12 +52,15 @@ public function up() $table->string('url')->nullable(); $table->integer('order')->nullable(); $table->tinyInteger('status')->default(0); + $table->integer('type')->nullable(); $table->timestamps(); }); Artisan::call('db:seed', ['--class' => 'DasNavigationTableSeeder']); } +} + /** * Reverse the migrations. diff --git a/database/migrations/2024_07_21_024936_delete_socialmedia_tbl_profil.php b/database/migrations/2024_07_21_024936_delete_socialmedia_tbl_profil.php new file mode 100644 index 000000000..ae3edc9f4 --- /dev/null +++ b/database/migrations/2024_07_21_024936_delete_socialmedia_tbl_profil.php @@ -0,0 +1,32 @@ +dropColumn('socialmedia'); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::table('das_profil', function (Blueprint $table) { + $table->json('socialmedia')->nullable(); + }); + } +}; diff --git a/database/migrations/2024_08_18_155051_update_komplain_anonim.php b/database/migrations/2024_08_18_155051_update_komplain_anonim.php new file mode 100644 index 000000000..2e25edeb8 --- /dev/null +++ b/database/migrations/2024_08_18_155051_update_komplain_anonim.php @@ -0,0 +1,41 @@ +dropColumn('anonim'); + }); + + Schema::table('das_komplain', function (Blueprint $table) { + $table->tinyInteger('anonim')->default(Anonim::Sembunyikan); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::table('das_komplain', function (Blueprint $table) { + $table->dropColumn('anonim'); + }); + + Schema::table('das_komplain', function (Blueprint $table) { + $table->tinyInteger('anonim')->nullable()->default(NULL); + }); + } +}; diff --git a/database/migrations/2024_08_22_213619_add_type_das_navigation.php b/database/migrations/2024_08_22_213619_add_type_das_navigation.php new file mode 100644 index 000000000..e6bec0016 --- /dev/null +++ b/database/migrations/2024_08_22_213619_add_type_das_navigation.php @@ -0,0 +1,44 @@ +tinyInteger('type')->default(0)->after('slug'); + }); + + Navigation::where('url', 'like', '%profil/%')->update(['type' => MenuTipe::PROFIL]); + Navigation::where('url', 'like', '%desa/%')->update(['type' => MenuTipe::DESA]); + Navigation::where('url', 'like', '%statistik/%')->update(['type' => MenuTipe::STATISTIK]); + Navigation::where('url', 'like', '%potensi/%')->update(['type' => MenuTipe::POTENSI]); + Navigation::where('url', 'like', '%unduhan/%')->update(['type' => MenuTipe::UNDUHAN]); + Navigation::where('url', '/')->update(['url' => url('/')]); + Navigation::where('url', '/faq')->update(['url' => url('/faq')]); + Navigation::where('url', '/berita-desa')->update(['url' => url('/berita-desa')]); + Navigation::where('url', '/#')->update(['url' => '#']); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::table('das_navigation', function (Blueprint $table) { + $table->dropColumn('type'); + }); + } +}; diff --git a/database/migrations/2024_08_26_071006_delete_duplicate_penduduk_by_nik.php b/database/migrations/2024_08_26_071006_delete_duplicate_penduduk_by_nik.php new file mode 100644 index 000000000..a935de095 --- /dev/null +++ b/database/migrations/2024_08_26_071006_delete_duplicate_penduduk_by_nik.php @@ -0,0 +1,39 @@ +select('nik', 'desa_id', DB::raw('COUNT(*) as `count`')) + ->groupBy('nik', 'desa_id') + ->having('count', '>', 1) + ->get(); + + foreach ($duplicates as $duplicate) { + $penduduk = Penduduk::where('nik', $duplicate->nik)->where('desa_id', $duplicate->desa_id)->orderBy('imported_at', 'desc')->first('id'); + Penduduk::where('nik', $duplicate->nik)->where('desa_id', $duplicate->desa_id)->where('id', '!=', $penduduk->id)->delete(); + } + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + // + } +}; diff --git a/database/seeders/DasNavigationTableSeeder.php b/database/seeders/DasNavigationTableSeeder.php index 436f92190..68d41e518 100644 --- a/database/seeders/DasNavigationTableSeeder.php +++ b/database/seeders/DasNavigationTableSeeder.php @@ -31,10 +31,11 @@ namespace Database\Seeders; +use App\Enums\MenuTipe; use App\Models\Navigation; +use Illuminate\Support\Str; use Illuminate\Database\Seeder; use Illuminate\Support\Facades\DB; -use Illuminate\Support\Str; class DasNavigationTableSeeder extends Seeder { @@ -47,82 +48,84 @@ public function run() { DB::table('das_navigation')->delete(); - // insert parents - DB::table('das_navigation')->insert([ + // Menu Utama + $menuUtama = [ [ 'name' => 'Beranda', 'slug' => Str::slug('Beranda'), - 'nav_type' => 'system', - 'url' => '/', + 'type' => MenuTipe::EKSTERNAL, + 'url' => url('/'), 'order' => 1, 'status' => 1, ], [ 'name' => 'Berita Desa', 'slug' => Str::slug('Berita Desa'), - 'nav_type' => 'system', - 'url' => '/berita-desa', + 'type' => MenuTipe::EKSTERNAL, + 'url' => url('berita-desa'), 'order' => 2, 'status' => 1, ], [ 'name' => 'Profil', 'slug' => Str::slug('Profil'), - 'nav_type' => 'system', - 'url' => '/#', + 'type' => MenuTipe::EKSTERNAL, + 'url' => '#', 'order' => 3, 'status' => 1, ], [ 'name' => 'Desa', 'slug' => Str::slug('Desa'), - 'nav_type' => 'system', - 'url' => '/#', + 'type' => MenuTipe::EKSTERNAL, + 'url' => '#', 'order' => 4, 'status' => 1, ], [ 'name' => 'Potensi', 'slug' => Str::slug('Potensi'), - 'nav_type' => 'system', - 'url' => '/#', + 'type' => MenuTipe::EKSTERNAL, + 'url' => '#', 'order' => 5, 'status' => 1, ], [ 'name' => 'Statistik', 'slug' => Str::slug('Statistik'), - 'nav_type' => 'system', - 'url' => '/#', + 'type' => MenuTipe::EKSTERNAL, + 'url' => '#', 'order' => 6, 'status' => 1, ], [ 'name' => 'Unduhan', 'slug' => Str::slug('Unduhan'), - 'nav_type' => 'system', - 'url' => '/#', + 'type' => MenuTipe::EKSTERNAL, + 'url' => '#', 'order' => 7, 'status' => 1, ], [ 'name' => 'FAQ', 'slug' => Str::slug('FAQ'), - 'nav_type' => 'system', - 'url' => '/faq', + 'type' => MenuTipe::EKSTERNAL, + 'url' => url('faq'), 'order' => 8, 'status' => 1, ], - ]); + ]; - // insert childs - DB::table('das_navigation')->insert([ + DB::table('das_navigation')->insert($menuUtama); + + // Submenu + $subMenu = [ [ 'parent_id' => Navigation::where('slug', 'profil')->first()->id, 'name' => 'Sejarah', 'slug' => 'profil-sejarah', - 'nav_type' => 'system', - 'url' => '/profil/sejarah', + 'type' => MenuTipe::PROFIL, + 'url' => 'profil/sejarah', 'order' => 1, 'status' => 1, ], @@ -130,8 +133,8 @@ public function run() 'parent_id' => Navigation::where('slug', 'profil')->first()->id, 'name' => 'Letak Geografis', 'slug' => 'profil-letak-geografis', - 'nav_type' => 'system', - 'url' => '/profil/letak-geografis', + 'type' => MenuTipe::PROFIL, + 'url' => 'profil/letak-geografis', 'order' => 2, 'status' => 1, ], @@ -139,8 +142,8 @@ public function run() 'parent_id' => Navigation::where('slug', 'profil')->first()->id, 'name' => 'Struktur Pemerintahan', 'slug' => 'profil-struktur-pemerintahan', - 'nav_type' => 'system', - 'url' => '/profil/struktur-pemerintahan', + 'type' => MenuTipe::PROFIL, + 'url' => 'profil/struktur-pemerintahan', 'order' => 3, 'status' => 1, ], @@ -148,8 +151,8 @@ public function run() 'parent_id' => Navigation::where('slug', 'profil')->first()->id, 'name' => 'Visi & Misi', 'slug' => 'profil-visi-misi', - 'nav_type' => 'system', - 'url' => '/profil/visi-misi', + 'type' => MenuTipe::PROFIL, + 'url' => 'profil/visi-misi', 'order' => 4, 'status' => 1, ], @@ -157,8 +160,8 @@ public function run() 'parent_id' => Navigation::where('slug', 'statistik')->first()->id, 'name' => 'Penduduk', 'slug' => 'statistik-penduduk', - 'nav_type' => 'system', - 'url' => '/statistik/kependudukan', + 'type' => MenuTipe::STATISTIK, + 'url' => 'statistik/kependudukan', 'order' => 1, 'status' => 1, ], @@ -166,8 +169,8 @@ public function run() 'parent_id' => Navigation::where('slug', 'statistik')->first()->id, 'name' => 'Pendidikan', 'slug' => 'statistik-pendidikan', - 'nav_type' => 'system', - 'url' => '/statistik/pendidikan', + 'type' => MenuTipe::STATISTIK, + 'url' => 'statistik/pendidikan', 'order' => 2, 'status' => 1, ], @@ -175,8 +178,8 @@ public function run() 'parent_id' => Navigation::where('slug', 'statistik')->first()->id, 'name' => 'Kesehatan', 'slug' => 'statistik-kesehatan', - 'nav_type' => 'system', - 'url' => '/statistik/kesehatan', + 'type' => MenuTipe::STATISTIK, + 'url' => 'statistik/kesehatan', 'order' => 3, 'status' => 1, ], @@ -184,8 +187,8 @@ public function run() 'parent_id' => Navigation::where('slug', 'statistik')->first()->id, 'name' => 'Program dan Bantuan', 'slug' => 'statistik-program-dan-bantuan', - 'nav_type' => 'system', - 'url' => '/statistik/program-dan-bantuan', + 'type' => MenuTipe::STATISTIK, + 'url' => 'statistik/program-dan-bantuan', 'order' => 4, 'status' => 1, ], @@ -193,8 +196,8 @@ public function run() 'parent_id' => Navigation::where('slug', 'statistik')->first()->id, 'name' => 'Anggaran dan Realisasi', 'slug' => 'statistik-anggaran-dan-realisasi', - 'nav_type' => 'system', - 'url' => '/statistik/anggaran-dan-realisasi', + 'type' => MenuTipe::STATISTIK, + 'url' => 'statistik/anggaran-dan-realisasi', 'order' => 5, 'status' => 1, ], @@ -202,8 +205,8 @@ public function run() 'parent_id' => Navigation::where('slug', 'statistik')->first()->id, 'name' => 'Anggaran Desa', 'slug' => 'statistik-anggaran-desa', - 'nav_type' => 'system', - 'url' => '/statistik/anggaran-desa', + 'type' => MenuTipe::STATISTIK, + 'url' => 'statistik/anggaran-desa', 'order' => 6, 'status' => 1, ], @@ -211,8 +214,8 @@ public function run() 'parent_id' => Navigation::where('slug', 'unduhan')->first()->id, 'name' => 'Prosedur', 'slug' => 'unduhan-prosedur', - 'nav_type' => 'system', - 'url' => '/unduhan/prosedur', + 'type' => MenuTipe::UNDUHAN, + 'url' => 'unduhan/prosedur', 'order' => 1, 'status' => 1, ], @@ -220,8 +223,8 @@ public function run() 'parent_id' => Navigation::where('slug', 'unduhan')->first()->id, 'name' => 'Regulasi', 'slug' => 'unduhan-regulasi', - 'nav_type' => 'system', - 'url' => '/unduhan/regulasi', + 'type' => MenuTipe::UNDUHAN, + 'url' => 'unduhan/regulasi', 'order' => 2, 'status' => 1, ], @@ -229,11 +232,38 @@ public function run() 'parent_id' => Navigation::where('slug', 'unduhan')->first()->id, 'name' => 'Dokumen', 'slug' => 'unduhan-dokumen', - 'nav_type' => 'system', - 'url' => '/unduhan/form-dokumen', + 'type' => MenuTipe::UNDUHAN, + 'url' => 'unduhan/form-dokumen', 'order' => 3, 'status' => 1, ] - ]); + ]; + + DB::table('das_data_desa')->get()->each(function ($data) use (&$subMenu) { + $slug = $data->sebutan_desa . '-' . Str::slug($data->nama); + $subMenu[] = [ + 'parent_id' => Navigation::where('slug', 'desa')->first()->id, + 'name' => ucwords($data->sebutan_desa . ' ' . $data->nama), + 'slug' => $slug, + 'type' => MenuTipe::DESA, + 'url' => 'desa/' . $slug, + 'order' => $data->id, + 'status' => 1, + ]; + }); + + DB::table('das_tipe_potensi')->get()->each(function ($data) use (&$subMenu) { + $subMenu[] = [ + 'parent_id' => Navigation::where('slug', 'potensi')->first()->id, + 'name' => $data->nama_kategori, + 'slug' => 'potensi-' . $data->slug, + 'type' => MenuTipe::POTENSI, + 'url' => 'potensi/' . $data->slug, + 'order' => $data->id, + 'status' => 1, + ]; + }); + + DB::table('das_navigation')->insert($subMenu); } } diff --git a/database/seeders/DasProfilTableSeeder.php b/database/seeders/DasProfilTableSeeder.php index 1cd17cd4f..b3d245dbd 100644 --- a/database/seeders/DasProfilTableSeeder.php +++ b/database/seeders/DasProfilTableSeeder.php @@ -82,7 +82,6 @@ public function run() 'file_logo' => null, 'visi' => null, 'misi' => null, - 'socialmedia' => json_encode($socialmedia), 'created_at' => now(), 'updated_at' => now(), ]); diff --git a/database/seeders/Demo/DemoDasNavigationTableSeeder.php b/database/seeders/Demo/DemoDasNavigationTableSeeder.php new file mode 100644 index 000000000..ba4d0c184 --- /dev/null +++ b/database/seeders/Demo/DemoDasNavigationTableSeeder.php @@ -0,0 +1,79 @@ +get()->each(function ($data) use (&$subMenu) { + $slug = $data->sebutan_desa . '-' . Str::slug($data->nama); + $subMenu[] = [ + 'parent_id' => Navigation::where('slug', 'desa')->first()->id, + 'name' => ucwords($data->sebutan_desa . ' ' . $data->nama), + 'slug' => $slug, + 'type' => MenuTipe::DESA, + 'url' => 'desa/' . $slug, + 'order' => $data->id, + 'status' => 1, + ]; + }); + + DB::table('das_tipe_potensi')->get()->each(function ($data) use (&$subMenu) { + $subMenu[] = [ + 'parent_id' => Navigation::where('slug', 'potensi')->first()->id, + 'name' => $data->nama_kategori, + 'slug' => 'potensi-' . $data->slug, + 'type' => MenuTipe::POTENSI, + 'url' => 'potensi/' . $data->slug, + 'order' => $data->id, + 'status' => 1, + ]; + }); + + DB::table('das_navigation')->insert($subMenu); + } +} diff --git a/database/seeders/DemoDatabaseSeeder.php b/database/seeders/DemoDatabaseSeeder.php index 1d60aa10a..a558e9462 100644 --- a/database/seeders/DemoDatabaseSeeder.php +++ b/database/seeders/DemoDatabaseSeeder.php @@ -60,6 +60,7 @@ use Database\Seeders\Demo\DemoPendudukKeluargaSeeder; use Database\Seeders\Demo\DemoAnggaranRealisasiSeeder; use Database\Seeders\Demo\DemoTingkatPendidikanSeeder; +use Database\Seeders\Demo\DemoDasNavigationTableSeeder; class DemoDatabaseSeeder extends Seeder { @@ -102,6 +103,7 @@ public function run() $this->call(DemoMediaSosialSeeder::class); $this->call(DemoSinergiProgramSeeder::class); $this->call(DemoSliderSeeder::class); + $this->call(DemoDasNavigationTableSeeder::class); DB::statement('SET FOREIGN_KEY_CHECKS=1;'); } diff --git a/helpers/general_helper.php b/helpers/general_helper.php index 88dbfe4f9..eb389067b 100644 --- a/helpers/general_helper.php +++ b/helpers/general_helper.php @@ -30,10 +30,12 @@ */ use App\Models\Menu; -use App\Models\Navigation; use App\Models\Role; +use App\Models\DataDesa; +use App\Models\Navigation; use Illuminate\Support\Carbon; use Illuminate\Support\Facades\Log; +use willvincent\Feeds\Facades\FeedsFacade; /** * Parsing url image dari rss feed description @@ -477,3 +479,37 @@ function theme_active() return \Hexadog\ThemesManager\Facades\ThemesManager::set($themeActive->slug); } } + +if (! function_exists('getFeeds')) { + function getFeeds() + { + return cache()->remember('feeds_desa', 60 * 60, function () { + $all_desa = DataDesa::websiteUrl()->get() + ->map(function ($desa) { + return $desa->website_url_feed; + })->all(); + + $feeds = []; + foreach ($all_desa as $desa) { + $getFeeds = FeedsFacade::make($desa['website'], 5, true); + foreach ($getFeeds->get_items() as $item) { + $feeds[] = [ + 'desa_id' => $desa['desa_id'], + 'nama_desa' => $desa['nama'], + 'feed_link' => $item->get_feed()->get_permalink(), + 'feed_title' => $item->get_feed()->get_title(), + 'link' => $item->get_link(), + 'date' => \Carbon\Carbon::parse($item->get_date('U')), + 'author' => $item->get_author()->get_name() ?? 'Administrator', + 'title' => $item->get_title(), + 'image' => get_tag_image($item->get_description()), + 'description' => strip_tags(substr(str_replace(['&', 'nbsp;', '[...]'], '', $item->get_description()), 0, 250).'[...]'), + 'content' => $item->get_content(), + ]; + } + } + + return $feeds ?? null; + }); + } +} \ No newline at end of file diff --git a/resources/views/data/profil/form_edit.blade.php b/resources/views/data/profil/form_edit.blade.php index 89007e366..6b66bad2b 100644 --- a/resources/views/data/profil/form_edit.blade.php +++ b/resources/views/data/profil/form_edit.blade.php @@ -144,46 +144,6 @@ -
- -
- @if (is_null($profil->socialmedia)) -
- - - -
-
-
- - - -
-
-
- - - -
-
-
- - - -
-
- @else - @foreach (json_decode($profil->socialmedia, true) as $sosmed) -
- - - -
-
- @endforeach - @endif -
-
diff --git a/resources/views/forms/aksi.blade.php b/resources/views/forms/aksi.blade.php index c0e568713..f1974aad5 100644 --- a/resources/views/forms/aksi.blade.php +++ b/resources/views/forms/aksi.blade.php @@ -66,6 +66,12 @@ @endif + @if (isset($anonim)) + + + + @endif @if (isset($show_web)) diff --git a/resources/views/forms/anonim-modal.blade.php b/resources/views/forms/anonim-modal.blade.php new file mode 100644 index 000000000..437a84662 --- /dev/null +++ b/resources/views/forms/anonim-modal.blade.php @@ -0,0 +1,44 @@ + + diff --git a/resources/views/layouts/app.blade.php b/resources/views/layouts/app.blade.php deleted file mode 100644 index 7f5077932..000000000 --- a/resources/views/layouts/app.blade.php +++ /dev/null @@ -1,115 +0,0 @@ - - - - - - - - - - - {{ $page_title ?? config('app.name', 'Laravel') }} | {{ $browser_title }} - - - - - - - - {{-- - --}} - - - - - - - - - - - - - - - - - - - - - - @stack('css') - - - - - - - - - - - - @include('partialspage.preloader') - -
- - - @include('layouts.frontends.topheader') - @include('layouts.frontends.header') -
- @include('layouts.frontends.slider') -
- -
-
- - @yield('content') - - @include('layouts.frontends.sidebar') -
-
- -
- -
- - @include('layouts.frontends.footer') -
- -
- - - -
- - - - - - - - - - - - - - - @stack('scripts') - - - diff --git a/resources/views/layouts/frontends/header.blade.php b/resources/views/layouts/frontends/header.blade.php deleted file mode 100644 index 82dd5e1cb..000000000 --- a/resources/views/layouts/frontends/header.blade.php +++ /dev/null @@ -1,118 +0,0 @@ - - - - - -@push('scripts') - -@endpush diff --git a/resources/views/pages/berita/index.blade.php b/resources/views/pages/berita/index.blade.php deleted file mode 100644 index d73f623ac..000000000 --- a/resources/views/pages/berita/index.blade.php +++ /dev/null @@ -1,26 +0,0 @@ -
-
- @forelse ($artikel as $item) -
-
-
- {{ $item->slug }} -
-
-
{{ $item->judul }}
-

 {{ format_date($item->created_at) }} |  Administrator

-

{{ strip_tags(substr($item->isi, 0, 250)) }}...

- Selengkapnya -
-
-
- @empty -
-

Tidak ada berita kecamatan yang ditampilkan!

-
- @endforelse -
- {{ $artikel->links('vendor.pagination.bootstrap-4') }} -
-
-
diff --git a/resources/views/setting/navigation/form.blade.php b/resources/views/setting/navigation/form.blade.php index 3ff384f69..d6192e241 100644 --- a/resources/views/setting/navigation/form.blade.php +++ b/resources/views/setting/navigation/form.blade.php @@ -6,15 +6,44 @@
- -
- {!! Form::select('nav_type', ['system' => 'System', 'external' => 'Eksternal'], 'system', ['class' => 'form-control', 'required' => true, 'id' => 'nav_type']) !!} + +
+
-
- +
+
- {!! Form::text('url', null, ['class' => 'form-control', 'required' => true, 'id' => 'url']) !!} + {!! Form::text('url', null, ['class' => 'form-control', 'required' => true, 'id' => 'url', 'value' => optional($navigation)->url]) !!}
@@ -24,3 +53,30 @@
+@push('scripts') + +@endpush diff --git a/resources/views/setting/navigation/index.blade.php b/resources/views/setting/navigation/index.blade.php index 60f256693..9cd1c76d1 100644 --- a/resources/views/setting/navigation/index.blade.php +++ b/resources/views/setting/navigation/index.blade.php @@ -36,8 +36,6 @@ Aksi Navigasi - Slug - Tipe Url Active @@ -70,18 +68,8 @@ class: 'text-center', orderable: false }, { - data: 'slug', - name: 'slug', - orderable: false - }, - { - data: 'nav_type', - name: 'nav_type', - orderable: false - }, - { - data: 'url', - name: 'url', + data: 'full_url', + name: 'full_url', orderable: false }, { diff --git a/resources/views/sistem_komplain/admin_komplain/edit.blade.php b/resources/views/sistem_komplain/edit.blade.php similarity index 100% rename from resources/views/sistem_komplain/admin_komplain/edit.blade.php rename to resources/views/sistem_komplain/edit.blade.php diff --git a/resources/views/sistem_komplain/admin_komplain/index.blade.php b/resources/views/sistem_komplain/index.blade.php similarity index 91% rename from resources/views/sistem_komplain/admin_komplain/index.blade.php rename to resources/views/sistem_komplain/index.blade.php index 23c5dbe79..a79a38662 100644 --- a/resources/views/sistem_komplain/admin_komplain/index.blade.php +++ b/resources/views/sistem_komplain/index.blade.php @@ -27,6 +27,7 @@ Pelapor Kategori Status + Identitas Pelapor @@ -69,6 +70,11 @@ class: 'text-center', name: 'status', class: 'status' }, + { + data: 'anonim', + name: 'anonim', + class: 'anonim' + }, ], order: [ [1, 'asc'] @@ -79,4 +85,5 @@ class: 'status' @include('forms.datatable-vertical') @include('forms.delete-modal') @include('forms.agree-modal') + @include('forms.anonim-modal') @endpush diff --git a/resources/views/sistem_komplain/admin_komplain/show.blade.php b/resources/views/sistem_komplain/show.blade.php similarity index 100% rename from resources/views/sistem_komplain/admin_komplain/show.blade.php rename to resources/views/sistem_komplain/show.blade.php diff --git a/resources/views/sistem_komplain/admin_komplain/statistik.blade.php b/resources/views/sistem_komplain/statistik.blade.php similarity index 100% rename from resources/views/sistem_komplain/admin_komplain/statistik.blade.php rename to resources/views/sistem_komplain/statistik.blade.php diff --git a/routes/web.php b/routes/web.php index 7fa1cdf9c..b775e9232 100644 --- a/routes/web.php +++ b/routes/web.php @@ -92,6 +92,7 @@ Route::get('visi-dan-misi', 'ProfilController@VisiMisi')->name('profil.visi-misi'); Route::get('tipologi', 'ProfilController@tipologi')->name('profil.tipologi'); Route::get('sejarah', 'ProfilController@sejarah')->name('profil.sejarah'); + Route::get('sambutan', 'ProfilController@Sambutan')->name('profil.sambutan'); }); Route::group(['prefix' => 'event'], function () { @@ -173,10 +174,7 @@ }); Route::get('faq', 'WebFaqController@index')->name('faq'); - }); - Route::get('agenda-kegiatan/{slug}', [EventController::class, 'show'])->name('event.show'); - Route::namespace('\App\Http\Controllers\SistemKomplain')->group(function () { Route::group(['prefix' => 'sistem-komplain'], function () { Route::get('/', ['as' => 'sistem-komplain.index', 'uses' => 'SistemKomplainController@index']); Route::get('kirim', ['as' => 'sistem-komplain.kirim', 'uses' => 'SistemKomplainController@kirim']); @@ -552,6 +550,7 @@ Route::put('update/{id}', ['as' => 'admin-komplain.update', 'uses' => 'AdminKomplainController@update']); Route::delete('destroy/{id}', ['as' => 'admin-komplain.destroy', 'uses' => 'AdminKomplainController@destroy']); Route::put('setuju/{id}', ['as' => 'admin-komplain.setuju', 'uses' => 'AdminKomplainController@disetujui']); + Route::put('anonim/{id}', ['as' => 'admin-komplain.anonim', 'uses' => 'AdminKomplainController@anonim']); Route::get('statistik', ['as' => 'admin-komplain.statistik', 'uses' => 'AdminKomplainController@statistik']); Route::get('show/{id}', ['as' => 'admin-komplain.show', 'uses' => 'AdminKomplainController@show']); Route::delete('deletekomentar/{id}', ['as' => 'admin-komplain.deletekomentar', 'uses' => 'AdminKomplainController@deletekomentar']); diff --git a/resources/views/layouts/frontends/breadcumb.blade.php b/themes/opendk/default/resources/views/components/breadcumb.blade.php similarity index 100% rename from resources/views/layouts/frontends/breadcumb.blade.php rename to themes/opendk/default/resources/views/components/breadcumb.blade.php diff --git a/resources/views/layouts/frontends/footer.blade.php b/themes/opendk/default/resources/views/components/footer.blade.php similarity index 100% rename from resources/views/layouts/frontends/footer.blade.php rename to themes/opendk/default/resources/views/components/footer.blade.php diff --git a/themes/opendk/default/resources/views/components/header.blade.php b/themes/opendk/default/resources/views/components/header.blade.php new file mode 100644 index 000000000..cae287bc9 --- /dev/null +++ b/themes/opendk/default/resources/views/components/header.blade.php @@ -0,0 +1,47 @@ + + + + diff --git a/resources/views/partialspage/preloader.blade.php b/themes/opendk/default/resources/views/components/preloader.blade.php similarity index 100% rename from resources/views/partialspage/preloader.blade.php rename to themes/opendk/default/resources/views/components/preloader.blade.php diff --git a/resources/views/layouts/frontends/sidebar.blade.php b/themes/opendk/default/resources/views/components/sidebar.blade.php similarity index 100% rename from resources/views/layouts/frontends/sidebar.blade.php rename to themes/opendk/default/resources/views/components/sidebar.blade.php diff --git a/resources/views/layouts/frontends/slider.blade.php b/themes/opendk/default/resources/views/components/slider.blade.php similarity index 100% rename from resources/views/layouts/frontends/slider.blade.php rename to themes/opendk/default/resources/views/components/slider.blade.php diff --git a/resources/views/layouts/frontends/topheader.blade.php b/themes/opendk/default/resources/views/components/topheader.blade.php similarity index 100% rename from resources/views/layouts/frontends/topheader.blade.php rename to themes/opendk/default/resources/views/components/topheader.blade.php diff --git a/themes/opendk/default/resources/views/layouts/app.blade.php b/themes/opendk/default/resources/views/layouts/app.blade.php index 80c8c7b67..b170ce9d4 100644 --- a/themes/opendk/default/resources/views/layouts/app.blade.php +++ b/themes/opendk/default/resources/views/layouts/app.blade.php @@ -44,7 +44,7 @@ - + - @include('partialspage.preloader') + @include('components.preloader')
- @include('layouts.frontends.topheader') - @include('layouts.frontends.header') + @include('components.topheader') + @include('components.header')
- @include('layouts.frontends.slider') + @include('components.slider')
@@ -77,7 +77,7 @@ @yield('content') - @include('layouts.frontends.sidebar') + @include('components.sidebar')
@@ -85,7 +85,7 @@
- @include('layouts.frontends.footer') + @include('components.footer')
diff --git a/resources/views/sistem_komplain/komplain/_komplain_populer.blade.php b/themes/opendk/default/resources/views/pages/komplain/_komplain_populer.blade.php similarity index 100% rename from resources/views/sistem_komplain/komplain/_komplain_populer.blade.php rename to themes/opendk/default/resources/views/pages/komplain/_komplain_populer.blade.php diff --git a/resources/views/sistem_komplain/komplain/_komplain_sukses.blade.php b/themes/opendk/default/resources/views/pages/komplain/_komplain_sukses.blade.php similarity index 100% rename from resources/views/sistem_komplain/komplain/_komplain_sukses.blade.php rename to themes/opendk/default/resources/views/pages/komplain/_komplain_sukses.blade.php diff --git a/resources/views/sistem_komplain/komplain/_tracking.blade.php b/themes/opendk/default/resources/views/pages/komplain/_tracking.blade.php similarity index 100% rename from resources/views/sistem_komplain/komplain/_tracking.blade.php rename to themes/opendk/default/resources/views/pages/komplain/_tracking.blade.php diff --git a/resources/views/sistem_komplain/komplain/edit.blade.php b/themes/opendk/default/resources/views/pages/komplain/edit.blade.php similarity index 98% rename from resources/views/sistem_komplain/komplain/edit.blade.php rename to themes/opendk/default/resources/views/pages/komplain/edit.blade.php index 1bd7e8f34..3ac9840b6 100644 --- a/resources/views/sistem_komplain/komplain/edit.blade.php +++ b/themes/opendk/default/resources/views/pages/komplain/edit.blade.php @@ -20,11 +20,11 @@
- @include('sistem_komplain.komplain._tracking') + @include('pages.komplain._tracking') - @include('sistem_komplain.komplain._komplain_populer') + @include('pages.komplain._komplain_populer') - @include('sistem_komplain.komplain._komplain_sukses') + @include('pages.komplain._komplain_sukses')
diff --git a/resources/views/sistem_komplain/komplain/index.blade.php b/themes/opendk/default/resources/views/pages/komplain/index.blade.php similarity index 92% rename from resources/views/sistem_komplain/komplain/index.blade.php rename to themes/opendk/default/resources/views/pages/komplain/index.blade.php index 252c07cf6..778a19fc7 100644 --- a/resources/views/sistem_komplain/komplain/index.blade.php +++ b/themes/opendk/default/resources/views/pages/komplain/index.blade.php @@ -18,7 +18,7 @@ {{ $item->judul }} {{ $item->kategori_komplain->nama }} - {{ $item->nama }} melaporkan - {{ diff_for_humans($item->created_at) }} + {{ auth()->guest() && $item->anonim ? 'Anonim' : $item->nama }} melaporkan - {{ diff_for_humans($item->created_at) }}

{!! get_words($item->laporan, 35) !!} ... diff --git a/resources/views/sistem_komplain/komplain/jawabans.blade.php b/themes/opendk/default/resources/views/pages/komplain/jawabans.blade.php similarity index 100% rename from resources/views/sistem_komplain/komplain/jawabans.blade.php rename to themes/opendk/default/resources/views/pages/komplain/jawabans.blade.php diff --git a/resources/views/sistem_komplain/komplain/kirim.blade.php b/themes/opendk/default/resources/views/pages/komplain/kirim.blade.php similarity index 100% rename from resources/views/sistem_komplain/komplain/kirim.blade.php rename to themes/opendk/default/resources/views/pages/komplain/kirim.blade.php diff --git a/resources/views/sistem_komplain/komplain/show.blade.php b/themes/opendk/default/resources/views/pages/komplain/show.blade.php similarity index 99% rename from resources/views/sistem_komplain/komplain/show.blade.php rename to themes/opendk/default/resources/views/pages/komplain/show.blade.php index a5a125aa2..75b771fa0 100644 --- a/resources/views/sistem_komplain/komplain/show.blade.php +++ b/themes/opendk/default/resources/views/pages/komplain/show.blade.php @@ -73,7 +73,7 @@ TRACKING ID #{{ $komplain->komplain_id }} - PELAPOR : {{ $komplain->nama }} + PELAPOR : {{ auth()->guest() && $komplain->anonim ? 'ANONIM' : $komplain->nama }}


diff --git a/themes/opendk/default/resources/views/pages/profil/sambutan.blade.php b/themes/opendk/default/resources/views/pages/profil/sambutan.blade.php new file mode 100644 index 000000000..0a189a3ae --- /dev/null +++ b/themes/opendk/default/resources/views/pages/profil/sambutan.blade.php @@ -0,0 +1,23 @@ +@extends('layouts.app') +@section('title', 'Sambutan') +@section('content') +
+
+
+

SAMBUTAN + {{ strtoupper($sebutan_kepala_wilayah) }} {{ strtoupper($profil->nama_kecamatan) }}

+
+
+
+ +

{{ $camat->namaGelar }}

+
{{ $sebutan_kepala_wilayah }} {{ $profil->nama_kecamatan }} +
+
+
+

{!! $profil->sambutan !!}

+
+
+
+@endsection diff --git a/resources/views/widgets/camat.blade.php b/themes/opendk/default/resources/views/widgets/camat.blade.php similarity index 100% rename from resources/views/widgets/camat.blade.php rename to themes/opendk/default/resources/views/widgets/camat.blade.php diff --git a/resources/views/widgets/event.blade.php b/themes/opendk/default/resources/views/widgets/event.blade.php similarity index 100% rename from resources/views/widgets/event.blade.php rename to themes/opendk/default/resources/views/widgets/event.blade.php diff --git a/resources/views/widgets/komplain.blade.php b/themes/opendk/default/resources/views/widgets/komplain.blade.php similarity index 69% rename from resources/views/widgets/komplain.blade.php rename to themes/opendk/default/resources/views/widgets/komplain.blade.php index 48050a149..32f7a7e90 100644 --- a/resources/views/widgets/komplain.blade.php +++ b/themes/opendk/default/resources/views/widgets/komplain.blade.php @@ -2,11 +2,11 @@

SIKEMA

- @include('sistem_komplain.komplain._tracking') + @include('pages.komplain._tracking') - @include('sistem_komplain.komplain._komplain_populer') + @include('pages.komplain._komplain_populer') - @include('sistem_komplain.komplain._komplain_sukses') + @include('pages.komplain._komplain_sukses')
diff --git a/resources/views/widgets/media_sosial.blade.php b/themes/opendk/default/resources/views/widgets/media_sosial.blade.php similarity index 100% rename from resources/views/widgets/media_sosial.blade.php rename to themes/opendk/default/resources/views/widgets/media_sosial.blade.php diff --git a/resources/views/widgets/pengurus.blade.php b/themes/opendk/default/resources/views/widgets/pengurus.blade.php similarity index 100% rename from resources/views/widgets/pengurus.blade.php rename to themes/opendk/default/resources/views/widgets/pengurus.blade.php diff --git a/resources/views/widgets/sinergi_program.blade.php b/themes/opendk/default/resources/views/widgets/sinergi_program.blade.php similarity index 100% rename from resources/views/widgets/sinergi_program.blade.php rename to themes/opendk/default/resources/views/widgets/sinergi_program.blade.php diff --git a/resources/views/widgets/visitor.blade.php b/themes/opendk/default/resources/views/widgets/visitor.blade.php similarity index 100% rename from resources/views/widgets/visitor.blade.php rename to themes/opendk/default/resources/views/widgets/visitor.blade.php