From 35942633277df7afd66c56be3e930b16aa8fa62e Mon Sep 17 00:00:00 2001 From: Arif Priadi Date: Wed, 14 Aug 2024 00:31:23 +0800 Subject: [PATCH 01/18] Fix: Template Issue Label Fitur --- .github/ISSUE_TEMPLATE/permintaan-fitur.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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: '' --- From 49e2a892c76d7b4682fd5fa26510c0d80fb3ba62 Mon Sep 17 00:00:00 2001 From: ahmad afandi Date: Wed, 21 Aug 2024 10:41:35 +0700 Subject: [PATCH 02/18] [ci skip] memutahirakan catatan rilis --- catatan_rilis.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/catatan_rilis.md b/catatan_rilis.md index c9f08bd71..8403b4482 100644 --- a/catatan_rilis.md +++ b/catatan_rilis.md @@ -14,4 +14,5 @@ Terima kasih pada @uddinmtm telah ikut berkontribusi. #### 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 \ No newline at end of file From 920ac370773481da81295dc102aeb897d03bd4f8 Mon Sep 17 00:00:00 2001 From: Arif Priadi <145224165+arifpriadi@users.noreply.github.com> Date: Wed, 21 Aug 2024 12:19:22 +0800 Subject: [PATCH 03/18] WIP: Remove Not Used (#981) Co-authored-by: ahmad afandi --- app/Models/Profil.php | 5 --- catatan_rilis.md | 4 +- ...1_024936_delete_socialmedia_tbl_profil.php | 32 +++++++++++++++ database/seeders/DasProfilTableSeeder.php | 1 - .../views/data/profil/form_edit.blade.php | 40 ------------------- 5 files changed, 34 insertions(+), 48 deletions(-) create mode 100644 database/migrations/2024_07_21_024936_delete_socialmedia_tbl_profil.php 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/catatan_rilis.md b/catatan_rilis.md index 8403b4482..4288123a2 100644 --- a/catatan_rilis.md +++ b/catatan_rilis.md @@ -10,9 +10,9 @@ Terima kasih pada @uddinmtm telah ikut berkontribusi. #### BUG 1. [#932](https://github.com/OpenSID/OpenDK/issues/932) Sesuaikan tombol batal dan kembali. - +2. [#980](https://github.com/OpenSID/OpenDK/issues/980) Hapus media sosial pada profile #### TEKNIS 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 \ No newline at end of file +2. [#1006](https://github.com/OpenSID/OpenDK/issues/1006) Template Issue Label Fitur 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/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/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 -
-
From d5825c34f6c4a9cd9b23af4a19145356e70e08aa Mon Sep 17 00:00:00 2001 From: Arif Priadi <145224165+arifpriadi@users.noreply.github.com> Date: Wed, 21 Aug 2024 12:37:43 +0800 Subject: [PATCH 04/18] WIP: Fix, Delete Unused Parts (#988) Co-authored-by: ahmad afandi --- .../Controllers/Setting/AplikasiController.php | 14 +------------- catatan_rilis.md | 1 + 2 files changed, 2 insertions(+), 13 deletions(-) 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/catatan_rilis.md b/catatan_rilis.md index 4288123a2..d21968b6f 100644 --- a/catatan_rilis.md +++ b/catatan_rilis.md @@ -16,3 +16,4 @@ Terima kasih pada @uddinmtm telah ikut berkontribusi. 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 \ No newline at end of file From 95d52bf5e63761b3102f400aed2ce8b9ad325d99 Mon Sep 17 00:00:00 2001 From: Arif Priadi <145224165+arifpriadi@users.noreply.github.com> Date: Wed, 21 Aug 2024 14:28:02 +0800 Subject: [PATCH 05/18] WIP: Fix Error Statistik Pendidikan (#1003) Co-authored-by: ahmad afandi --- app/Http/Controllers/FrontEnd/PendidikanController.php | 4 ++-- catatan_rilis.md | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) 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/catatan_rilis.md b/catatan_rilis.md index d21968b6f..2290554d9 100644 --- a/catatan_rilis.md +++ b/catatan_rilis.md @@ -11,7 +11,7 @@ Terima kasih pada @uddinmtm telah ikut berkontribusi. 1. [#932](https://github.com/OpenSID/OpenDK/issues/932) Sesuaikan tombol batal dan kembali. 2. [#980](https://github.com/OpenSID/OpenDK/issues/980) Hapus media sosial pada profile - +3. [#1002](https://github.com/OpenSID/OpenDK/issues/1002) Fix Error Statistik Pendidikan #### TEKNIS 1. [#982](https://github.com/OpenSID/OpenDK/issues/982) Perbaikan celah di API list penduduk dan kk. From 7f769def668a1fc910b9bb910f51e961da58a5e3 Mon Sep 17 00:00:00 2001 From: Arif Priadi <145224165+arifpriadi@users.noreply.github.com> Date: Wed, 21 Aug 2024 15:11:03 +0800 Subject: [PATCH 06/18] WIP: Fix Feeds (#1005) mas @arifpriadi cek perbaikan Co-authored-by: ahmad afandi --- .../Controllers/FrontEnd/PageController.php | 27 +------------ catatan_rilis.md | 3 +- helpers/general_helper.php | 38 ++++++++++++++++++- 3 files changed, 40 insertions(+), 28 deletions(-) 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/catatan_rilis.md b/catatan_rilis.md index 2290554d9..21f96edf3 100644 --- a/catatan_rilis.md +++ b/catatan_rilis.md @@ -16,4 +16,5 @@ Terima kasih pada @uddinmtm telah ikut berkontribusi. 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 \ No newline at end of file +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 \ No newline at end of file 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 From 75491a99694cd1f0f87950cf8ce1c6ccba85878a Mon Sep 17 00:00:00 2001 From: Abah Roland <59082428+vickyrolanda@users.noreply.github.com> Date: Thu, 22 Aug 2024 09:25:20 +0700 Subject: [PATCH 07/18] [ci skip] memutahirkan catatan rilis --- catatan_rilis.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/catatan_rilis.md b/catatan_rilis.md index 21f96edf3..469ec6229 100644 --- a/catatan_rilis.md +++ b/catatan_rilis.md @@ -12,6 +12,8 @@ Terima kasih pada @uddinmtm telah ikut berkontribusi. 1. [#932](https://github.com/OpenSID/OpenDK/issues/932) Sesuaikan tombol batal dan kembali. 2. [#980](https://github.com/OpenSID/OpenDK/issues/980) Hapus media sosial pada profile 3. [#1002](https://github.com/OpenSID/OpenDK/issues/1002) Fix Error Statistik Pendidikan +4. [#1008](https://github.com/OpenSID/OpenDK/issues/1008) Perbaikan error tidak bisa mengirim keluhan di sikema. + #### TEKNIS 1. [#982](https://github.com/OpenSID/OpenDK/issues/982) Perbaikan celah di API list penduduk dan kk. From 5b029b2b0de56bf747d44628e3b3be0ef4e7d73b Mon Sep 17 00:00:00 2001 From: Yogi Perdana Date: Thu, 22 Aug 2024 09:25:55 +0700 Subject: [PATCH 08/18] Perbaikan error tidak bisa mengirim keluhan di sikema (#1009) Co-authored-by: Abah Roland <59082428+vickyrolanda@users.noreply.github.com> --- .../Controllers/SistemKomplain/SistemKomplainController.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/Http/Controllers/SistemKomplain/SistemKomplainController.php b/app/Http/Controllers/SistemKomplain/SistemKomplainController.php index f05c251f0..e0a827cec 100644 --- a/app/Http/Controllers/SistemKomplain/SistemKomplainController.php +++ b/app/Http/Controllers/SistemKomplain/SistemKomplainController.php @@ -31,15 +31,15 @@ namespace App\Http\Controllers\SistemKomplain; -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() { From 24314b79ee5836704caa8da7ff1c75185b34dbf9 Mon Sep 17 00:00:00 2001 From: Arif Priadi <145224165+arifpriadi@users.noreply.github.com> Date: Fri, 23 Aug 2024 07:21:16 +0800 Subject: [PATCH 09/18] WIP: Fix Navigation + Add Default Navigation System (#986) Co-authored-by: ahmad afandi --- app/Enums/MenuTipe.php | 105 ++++++++++++++ .../Setting/NavigationController.php | 6 +- app/Http/Requests/NavigationRequest.php | 2 +- app/Models/Navigation.php | 52 ++++++- catatan_rilis.md | 1 + ...4_08_22_213619_add_type_das_navigation.php | 44 ++++++ database/seeders/DasNavigationTableSeeder.php | 128 +++++++++++------- .../Demo/DemoDasNavigationTableSeeder.php | 79 +++++++++++ database/seeders/DemoDatabaseSeeder.php | 2 + .../views/layouts/frontends/header.blade.php | 97 ++----------- .../views/setting/navigation/form.blade.php | 68 +++++++++- .../views/setting/navigation/index.blade.php | 16 +-- 12 files changed, 439 insertions(+), 161 deletions(-) create mode 100644 app/Enums/MenuTipe.php create mode 100644 database/migrations/2024_08_22_213619_add_type_das_navigation.php create mode 100644 database/seeders/Demo/DemoDasNavigationTableSeeder.php diff --git a/app/Enums/MenuTipe.php b/app/Enums/MenuTipe.php new file mode 100644 index 000000000..7f97f116c --- /dev/null +++ b/app/Enums/MenuTipe.php @@ -0,0 +1,105 @@ + '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', + ]; + } + + 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/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/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/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/catatan_rilis.md b/catatan_rilis.md index 469ec6229..101261d07 100644 --- a/catatan_rilis.md +++ b/catatan_rilis.md @@ -13,6 +13,7 @@ Terima kasih pada @uddinmtm telah ikut berkontribusi. 2. [#980](https://github.com/OpenSID/OpenDK/issues/980) Hapus media sosial pada profile 3. [#1002](https://github.com/OpenSID/OpenDK/issues/1002) Fix Error Statistik Pendidikan 4. [#1008](https://github.com/OpenSID/OpenDK/issues/1008) Perbaikan error tidak bisa mengirim keluhan di sikema. +5. [#985](https://github.com/OpenSID/OpenDK/issues/985) Perbaikan navigasi default #### TEKNIS 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/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/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/resources/views/layouts/frontends/header.blade.php b/resources/views/layouts/frontends/header.blade.php index 82dd5e1cb..cae287bc9 100644 --- a/resources/views/layouts/frontends/header.blade.php +++ b/resources/views/layouts/frontends/header.blade.php @@ -15,83 +15,25 @@
- -
- {!! 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 \ No newline at end of file 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 }, { From 1e6fd5712216da0f4ff100e8494d06252b6de81c Mon Sep 17 00:00:00 2001 From: Arif Priadi <145224165+arifpriadi@users.noreply.github.com> Date: Fri, 23 Aug 2024 07:27:24 +0800 Subject: [PATCH 10/18] WIP: gitignore folder themes (#997) --- .gitignore | 4 ++++ 1 file changed, 4 insertions(+) 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 From c1c7de978636a33173c6e28d309257e73310d8eb Mon Sep 17 00:00:00 2001 From: Arif Priadi <145224165+arifpriadi@users.noreply.github.com> Date: Mon, 26 Aug 2024 10:04:33 +0800 Subject: [PATCH 11/18] WIP: Fix Delete Slide (#990) Co-authored-by: ahmad afandi --- .../Controllers/Setting/SlideController.php | 25 +++++++------------ app/Models/Slide.php | 22 ++++++++++++++++ catatan_rilis.md | 1 + 3 files changed, 32 insertions(+), 16 deletions(-) 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/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 101261d07..7886b8cb9 100644 --- a/catatan_rilis.md +++ b/catatan_rilis.md @@ -14,6 +14,7 @@ Terima kasih pada @uddinmtm telah ikut berkontribusi. 3. [#1002](https://github.com/OpenSID/OpenDK/issues/1002) Fix Error Statistik Pendidikan 4. [#1008](https://github.com/OpenSID/OpenDK/issues/1008) Perbaikan error tidak bisa mengirim keluhan di sikema. 5. [#985](https://github.com/OpenSID/OpenDK/issues/985) Perbaikan navigasi default +6. [#990](https://github.com/OpenSID/OpenDK/issues/990) Perbaikan error ketika hapus slide tanpa gambar #### TEKNIS From 3ff42a79f711f7587177b9d287c3cb0586126487 Mon Sep 17 00:00:00 2001 From: Arif Priadi <145224165+arifpriadi@users.noreply.github.com> Date: Mon, 26 Aug 2024 10:10:09 +0800 Subject: [PATCH 12/18] WIP: Halaman Sambutan (#999) Co-authored-by: ahmad afandi --- app/Enums/MenuTipe.php | 1 + .../Controllers/FrontEnd/ProfilController.php | 13 +++++++++++ catatan_rilis.md | 1 + routes/web.php | 1 + .../views/pages/profil/sambutan.blade.php | 23 +++++++++++++++++++ 5 files changed, 39 insertions(+) create mode 100644 themes/opendk/default/resources/views/pages/profil/sambutan.blade.php diff --git a/app/Enums/MenuTipe.php b/app/Enums/MenuTipe.php index 7f97f116c..f1c3f056e 100644 --- a/app/Enums/MenuTipe.php +++ b/app/Enums/MenuTipe.php @@ -68,6 +68,7 @@ public static function getProfil(): array 'visi-dan-misi' => 'Visi dan Misi', 'letak-geografis' => 'Letak Geografis', 'struktur-pemerintahan' => 'Struktur Pemerintahan', + 'sambutan' => 'Sambutan' ]; } 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/catatan_rilis.md b/catatan_rilis.md index 7886b8cb9..a97653b45 100644 --- a/catatan_rilis.md +++ b/catatan_rilis.md @@ -5,6 +5,7 @@ Terima kasih pada @uddinmtm telah ikut berkontribusi. #### FITUR 1. [#511](https://github.com/OpenSID/OpenDK/issues/511) Penambahan modul navigasi halaman publik. +2. [#998](https://github.com/OpenSID/OpenDK/issues/998) Penambahan sambutan pada daftar menu navigasi. #### BUG diff --git a/routes/web.php b/routes/web.php index 7fa1cdf9c..3db028d54 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 () { 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 From 57aef3eaee84a4f84c9fbe7731f7a0e242daf772 Mon Sep 17 00:00:00 2001 From: Arif Priadi <145224165+arifpriadi@users.noreply.github.com> Date: Mon, 26 Aug 2024 10:24:21 +0800 Subject: [PATCH 13/18] Themes Component (#1001) Co-authored-by: ahmad afandi --- .../Data/AdminKomplainController.php | 8 +- .../SistemKomplainController.php | 14 +-- catatan_rilis.md | 3 +- resources/views/layouts/app.blade.php | 115 ------------------ resources/views/pages/berita/index.blade.php | 26 ---- .../{admin_komplain => }/edit.blade.php | 0 .../{admin_komplain => }/index.blade.php | 0 .../{admin_komplain => }/show.blade.php | 0 .../{admin_komplain => }/statistik.blade.php | 0 routes/web.php | 3 - .../views/components}/breadcumb.blade.php | 0 .../views/components}/footer.blade.php | 0 .../views/components}/header.blade.php | 0 .../views/components}/preloader.blade.php | 0 .../views/components}/sidebar.blade.php | 0 .../views/components}/slider.blade.php | 0 .../views/components}/topheader.blade.php | 0 .../resources/views/layouts/app.blade.php | 14 +-- .../komplain/_komplain_populer.blade.php | 0 .../komplain/_komplain_sukses.blade.php | 0 .../views/pages}/komplain/_tracking.blade.php | 0 .../views/pages}/komplain/edit.blade.php | 6 +- .../views/pages}/komplain/index.blade.php | 0 .../views/pages}/komplain/jawabans.blade.php | 0 .../views/pages}/komplain/kirim.blade.php | 0 .../views/pages}/komplain/show.blade.php | 0 .../resources}/views/widgets/camat.blade.php | 0 .../resources}/views/widgets/event.blade.php | 0 .../views/widgets/komplain.blade.php | 6 +- .../views/widgets/media_sosial.blade.php | 0 .../views/widgets/pengurus.blade.php | 0 .../views/widgets/sinergi_program.blade.php | 0 .../views/widgets/visitor.blade.php | 0 33 files changed, 26 insertions(+), 169 deletions(-) rename app/Http/Controllers/{SistemKomplain => FrontEnd}/SistemKomplainController.php (93%) delete mode 100644 resources/views/layouts/app.blade.php delete mode 100644 resources/views/pages/berita/index.blade.php rename resources/views/sistem_komplain/{admin_komplain => }/edit.blade.php (100%) rename resources/views/sistem_komplain/{admin_komplain => }/index.blade.php (100%) rename resources/views/sistem_komplain/{admin_komplain => }/show.blade.php (100%) rename resources/views/sistem_komplain/{admin_komplain => }/statistik.blade.php (100%) rename {resources/views/layouts/frontends => themes/opendk/default/resources/views/components}/breadcumb.blade.php (100%) rename {resources/views/layouts/frontends => themes/opendk/default/resources/views/components}/footer.blade.php (100%) rename {resources/views/layouts/frontends => themes/opendk/default/resources/views/components}/header.blade.php (100%) rename {resources/views/partialspage => themes/opendk/default/resources/views/components}/preloader.blade.php (100%) rename {resources/views/layouts/frontends => themes/opendk/default/resources/views/components}/sidebar.blade.php (100%) rename {resources/views/layouts/frontends => themes/opendk/default/resources/views/components}/slider.blade.php (100%) rename {resources/views/layouts/frontends => themes/opendk/default/resources/views/components}/topheader.blade.php (100%) rename {resources/views/sistem_komplain => themes/opendk/default/resources/views/pages}/komplain/_komplain_populer.blade.php (100%) rename {resources/views/sistem_komplain => themes/opendk/default/resources/views/pages}/komplain/_komplain_sukses.blade.php (100%) rename {resources/views/sistem_komplain => themes/opendk/default/resources/views/pages}/komplain/_tracking.blade.php (100%) rename {resources/views/sistem_komplain => themes/opendk/default/resources/views/pages}/komplain/edit.blade.php (98%) rename {resources/views/sistem_komplain => themes/opendk/default/resources/views/pages}/komplain/index.blade.php (100%) rename {resources/views/sistem_komplain => themes/opendk/default/resources/views/pages}/komplain/jawabans.blade.php (100%) rename {resources/views/sistem_komplain => themes/opendk/default/resources/views/pages}/komplain/kirim.blade.php (100%) rename {resources/views/sistem_komplain => themes/opendk/default/resources/views/pages}/komplain/show.blade.php (100%) rename {resources => themes/opendk/default/resources}/views/widgets/camat.blade.php (100%) rename {resources => themes/opendk/default/resources}/views/widgets/event.blade.php (100%) rename {resources => themes/opendk/default/resources}/views/widgets/komplain.blade.php (69%) rename {resources => themes/opendk/default/resources}/views/widgets/media_sosial.blade.php (100%) rename {resources => themes/opendk/default/resources}/views/widgets/pengurus.blade.php (100%) rename {resources => themes/opendk/default/resources}/views/widgets/sinergi_program.blade.php (100%) rename {resources => themes/opendk/default/resources}/views/widgets/visitor.blade.php (100%) diff --git a/app/Http/Controllers/Data/AdminKomplainController.php b/app/Http/Controllers/Data/AdminKomplainController.php index fa113afda..c84f02690 100644 --- a/app/Http/Controllers/Data/AdminKomplainController.php +++ b/app/Http/Controllers/Data/AdminKomplainController.php @@ -49,7 +49,7 @@ public function index() $page_title = 'Keluhan'; $page_description = 'Daftar Keluhan'; - return view('sistem_komplain.admin_komplain.index', compact('page_title', 'page_description')); + return view('sistem_komplain.index', compact('page_title', 'page_description')); } /** @@ -117,7 +117,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 +132,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 +228,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/SistemKomplain/SistemKomplainController.php b/app/Http/Controllers/FrontEnd/SistemKomplainController.php similarity index 93% rename from app/Http/Controllers/SistemKomplain/SistemKomplainController.php rename to app/Http/Controllers/FrontEnd/SistemKomplainController.php index e0a827cec..003782101 100644 --- a/app/Http/Controllers/SistemKomplain/SistemKomplainController.php +++ b/app/Http/Controllers/FrontEnd/SistemKomplainController.php @@ -29,7 +29,7 @@ * @link https://github.com/OpenSID/opendk */ -namespace App\Http\Controllers\SistemKomplain; +namespace App\Http\Controllers\FrontEnd; use App\Models\Komplain; use App\Models\Penduduk; @@ -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/catatan_rilis.md b/catatan_rilis.md index a97653b45..2e2c24dee 100644 --- a/catatan_rilis.md +++ b/catatan_rilis.md @@ -22,4 +22,5 @@ Terima kasih pada @uddinmtm telah ikut berkontribusi. 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 \ No newline at end of file +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/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/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/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 100% rename from resources/views/sistem_komplain/admin_komplain/index.blade.php rename to resources/views/sistem_komplain/index.blade.php 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 3db028d54..0cee71c54 100644 --- a/routes/web.php +++ b/routes/web.php @@ -174,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']); 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/resources/views/layouts/frontends/header.blade.php b/themes/opendk/default/resources/views/components/header.blade.php similarity index 100% rename from resources/views/layouts/frontends/header.blade.php rename to themes/opendk/default/resources/views/components/header.blade.php 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 100% rename from resources/views/sistem_komplain/komplain/index.blade.php rename to themes/opendk/default/resources/views/pages/komplain/index.blade.php 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 100% rename from resources/views/sistem_komplain/komplain/show.blade.php rename to themes/opendk/default/resources/views/pages/komplain/show.blade.php 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 From b93588a969d0d29a2bd5cb7e27798506a9a97486 Mon Sep 17 00:00:00 2001 From: Yogi Perdana Date: Tue, 27 Aug 2024 06:34:08 +0700 Subject: [PATCH 14/18] Perbaikan error migrasi tema (#1015) Co-authored-by: Abah Roland <59082428+vickyrolanda@users.noreply.github.com> --- app/Enums/Tema.php | 43 +++++++++++++++++ catatan_rilis.md | 2 + .../2024_06_03_042202_create_themes.php | 46 ++++++++++++------- 3 files changed, 75 insertions(+), 16 deletions(-) create mode 100644 app/Enums/Tema.php 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 @@ +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()); + } } /** From a37aa02778c3e17c8dd6a06e8a2b6e0725e56769 Mon Sep 17 00:00:00 2001 From: Yogi Perdana Date: Tue, 27 Aug 2024 06:38:43 +0700 Subject: [PATCH 15/18] Perbaikan penduduk nik ganda (#1018) Co-authored-by: Abah Roland <59082428+vickyrolanda@users.noreply.github.com> --- catatan_rilis.md | 1 + ...71006_delete_duplicate_penduduk_by_nik.php | 39 +++++++++++++++++++ 2 files changed, 40 insertions(+) create mode 100644 database/migrations/2024_08_26_071006_delete_duplicate_penduduk_by_nik.php diff --git a/catatan_rilis.md b/catatan_rilis.md index d1d088097..e10b84861 100644 --- a/catatan_rilis.md +++ b/catatan_rilis.md @@ -18,6 +18,7 @@ Terima kasih pada @uddinmtm telah ikut berkontribusi. 6. [#990](https://github.com/OpenSID/OpenDK/issues/990) Perbaikan error ketika hapus slide tanpa gambar 7. [#994](https://github.com/OpenSID/OpenDK/issues/994) Perbaikan error migrasi tema. 8. [#992](https://github.com/OpenSID/OpenDK/issues/992) Perbaikan error setelah update terbaru. +10. [#993](https://github.com/OpenSID/OpenDK/issues/993) Perbaikan penduduk nik ganda. #### TEKNIS 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() + { + // + } +}; From 7c3fe983440131131e1b274df46e0c1ae30ced4a Mon Sep 17 00:00:00 2001 From: Yogi Perdana Date: Tue, 27 Aug 2024 08:05:14 +0700 Subject: [PATCH 16/18] Identitas pelapor (#1010) Co-authored-by: yogiperdana Co-authored-by: Abah Roland <59082428+vickyrolanda@users.noreply.github.com> Co-authored-by: vickyrolanda --- app/Enums/Anonim.php | 43 ++++++++++++++++++ .../Data/AdminKomplainController.php | 32 +++++++++++++- app/Models/Komplain.php | 2 +- catatan_rilis.md | 1 + ...24_08_18_155051_update_komplain_anonim.php | 41 +++++++++++++++++ resources/views/forms/aksi.blade.php | 6 +++ resources/views/forms/anonim-modal.blade.php | 44 +++++++++++++++++++ .../views/setting/navigation/form.blade.php | 32 +++++++------- .../views/sistem_komplain/index.blade.php | 7 +++ routes/web.php | 1 + .../views/pages/komplain/index.blade.php | 2 +- .../views/pages/komplain/show.blade.php | 2 +- 12 files changed, 193 insertions(+), 20 deletions(-) create mode 100644 app/Enums/Anonim.php create mode 100644 database/migrations/2024_08_18_155051_update_komplain_anonim.php create mode 100644 resources/views/forms/anonim-modal.blade.php 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 @@ +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); 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/catatan_rilis.md b/catatan_rilis.md index e10b84861..28215e53c 100644 --- a/catatan_rilis.md +++ b/catatan_rilis.md @@ -6,6 +6,7 @@ Terima kasih pada @uddinmtm telah ikut berkontribusi. 1. [#511](https://github.com/OpenSID/OpenDK/issues/511) Penambahan modul navigasi halaman publik. 2. [#998](https://github.com/OpenSID/OpenDK/issues/998) Penambahan sambutan pada daftar menu navigasi. +3. [#669](https://github.com/OpenSID/OpenDK/issues/669) Penambahan identitas pelapor. #### BUG 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/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/setting/navigation/form.blade.php b/resources/views/setting/navigation/form.blade.php index df02f99ea..d6192e241 100644 --- a/resources/views/setting/navigation/form.blade.php +++ b/resources/views/setting/navigation/form.blade.php @@ -11,29 +11,29 @@