From c553960ac9f6ce94338441a6a5de2c10603e3b07 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=9Cmit=20Tun=C3=A7?= Date: Wed, 29 Apr 2026 06:21:57 +0300 Subject: [PATCH] feat: add modules management view with DevExtreme data grid and level permissions interface --- resources/views/admin/new/types2.blade.php | 484 +++++++++++++-------- 1 file changed, 313 insertions(+), 171 deletions(-) diff --git a/resources/views/admin/new/types2.blade.php b/resources/views/admin/new/types2.blade.php index 6dd5c21..856afdc 100644 --- a/resources/views/admin/new/types2.blade.php +++ b/resources/views/admin/new/types2.blade.php @@ -56,167 +56,9 @@
-
-
-
-
-
- - - -
- -
-
-
- -
- - - - - - - - - - - - - - - @foreach($types as $a) - - - - - - - - - - - - @endforeach - -
{{__("Status")}}{{__("Mobile")}}{{__("Icon")}}{{__("Module Info")}}{{__("Slug / Parent")}}{{__("Order")}}{{__("Permissions")}}
- - - - -
- icon . ".png")}}" width="24" alt="" - class="img-fluid"> -
-
-
- -
-
- -
- -
-
-
-
-
-
- -
- -
- -
-
- - -
- @php - $permTypes = [ - ['key' => 'full_control', 'label' => 'Full', 'icon' => 'fa-lock'], - ['key' => 'write', 'label' => 'Write', 'icon' => 'fa-pencil-alt'], - ['key' => 'read', 'label' => 'Read', 'icon' => 'fa-eye'], - ['key' => 'modify', 'label' => 'Mod', 'icon' => 'fa-edit'], - ]; - @endphp - @foreach($permTypes as $pt) -
- {{ $pt['label'] }} -
-
- @foreach(explode(',', $a->{$pt['key']}) as $level) - @if($level !== '') - {{ trim($level) }} - @endif - @endforeach -
- - -
-
- @endforeach -
-
-
- - - - - - - -
-
-
+
+
@@ -268,13 +110,289 @@ @@ -416,6 +534,14 @@ ); }); + Swal.fire({ + icon: 'success', + title: '{{__("Saved")}}', + text: '{{__("Permissions updated successfully")}}', + timer: 1500, + showConfirmButton: false + }); + $('#levelModal').modal('hide'); }); @@ -857,18 +983,34 @@ try { var res = typeof response === 'string' ? JSON.parse(response) : response; if (res.status === 'success') { - $('#specificPermissionsModal').modal('hide'); - location.reload(); + Swal.fire({ + icon: 'success', + title: '{{__("Saved")}}', + text: '{{__("Specific permissions updated successfully")}}', + timer: 1500, + showConfirmButton: false + }).then(() => { + $('#specificPermissionsModal').modal('hide'); + location.reload(); + }); } else { - alert('Error: ' + (res.message || 'Unknown error')); + Swal.fire({ + icon: 'error', + title: '{{e2("Error")}}', + text: res.message || 'Unknown error' + }); } } catch (e) { console.error("Response parse error", e); - location.reload(); // Assume success if parse fails but request worked + location.reload(); } }, error: function () { - alert('An error occurred while saving.'); + Swal.fire({ + icon: 'error', + title: '{{e2("Error")}}', + text: 'An error occurred while saving.' + }); } }); });