From 7564be934988ae9c46246dc9fd9c5e4a6e9af510 Mon Sep 17 00:00:00 2001 From: armiejean Date: Wed, 16 Apr 2025 01:02:22 +0800 Subject: [PATCH] added notification --- .../views/components/layouts/app.blade.php | 30 ------ .../views/pages/add-notification.blade.php | 95 +++++++++++++++++++ resources/views/pages/notification.blade.php | 79 +++++++++++++-- routes/web.php | 6 +- 4 files changed, 169 insertions(+), 41 deletions(-) delete mode 100644 resources/views/components/layouts/app.blade.php create mode 100644 resources/views/pages/add-notification.blade.php diff --git a/resources/views/components/layouts/app.blade.php b/resources/views/components/layouts/app.blade.php deleted file mode 100644 index 84c926f..0000000 --- a/resources/views/components/layouts/app.blade.php +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - Unioil - @yield('title') - - - - - - - - - @if(app()->environment('local')) - - @endif - - -
- @yield('content') -
- - @stack('scripts') - - - - diff --git a/resources/views/pages/add-notification.blade.php b/resources/views/pages/add-notification.blade.php new file mode 100644 index 0000000..23ab921 --- /dev/null +++ b/resources/views/pages/add-notification.blade.php @@ -0,0 +1,95 @@ +@extends('layouts.app') + +@section('page_title', 'Add Notification') + +@section('content') +
+
+
Add Notification
+
+
+
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+
+
+ + + + +@endsection \ No newline at end of file diff --git a/resources/views/pages/notification.blade.php b/resources/views/pages/notification.blade.php index 28a7ad7..85b5117 100644 --- a/resources/views/pages/notification.blade.php +++ b/resources/views/pages/notification.blade.php @@ -1,14 +1,73 @@ @extends('layouts.app') -@section('page_title', 'Notifications') +@section('page_title', 'Notification') @section('content') -
-
- Notifications -
-
-

This is the Notification page content.

-
-
-@endsection + @php + $notifications = [ + [ + 'id' => 1, + 'subject' => 'Welcome Message', + 'content' => 'Welcome to our platform! Get started today.', + 'isScheduled' => 'Scheduled', + 'schedule' => '2025-04-16 10:00', + 'expiration' => '2025-04-30 23:59' + ], + [ + 'id' => 2, + 'subject' => 'System Update', + 'content' => 'Scheduled maintenance on April 20th.', + 'isScheduled' => 'Scheduled', + 'schedule' => '2025-04-20 02:00', + 'expiration' => '2025-04-21 02:00' + ], + [ + 'id' => 3, + 'subject' => 'Promotion Offer', + 'content' => '50% off your next purchase this week!', + 'isScheduled' => 'Not Scheduled', + 'schedule' => '', + 'expiration' => '2025-04-22 23:59' + ], + [ + 'id' => 4, + 'subject' => 'Account Reminder', + 'content' => 'Please update your profile details.', + 'isScheduled' => 'Scheduled', + 'schedule' => '2025-04-18 09:00', + 'expiration' => '2025-04-25 23:59' + ] + ]; + @endphp + + @include('components.table-component', [ + 'pageTitle' => 'Notification', + 'data' => $notifications, + 'columns' => [ + ['name' => 'ID', 'key' => 'id', 'sortable' => true], + ['name' => 'Subject', 'key' => 'subject', 'sortable' => true], + ['name' => 'Content', 'key' => 'content', 'sortable' => true], + ['name' => 'Is Scheduled', 'key' => 'isScheduled', 'sortable' => true], + ['name' => 'Schedule', 'key' => 'schedule', 'sortable' => true], + ['name' => 'Expiration', 'key' => 'expiration', 'sortable' => true] + ], + + 'showAddButton' => true, + 'addButtonUrl' => '/add-notification', + 'showCheckboxes' => false, + 'showBatchDelete' => false, + 'showEditModal' => false, + 'showViewModal' => true + ]) + + +@endsection \ No newline at end of file diff --git a/routes/web.php b/routes/web.php index 0e31d06..8de9e0b 100644 --- a/routes/web.php +++ b/routes/web.php @@ -86,4 +86,8 @@ Route::get('/my-profile', function () { Route::get('/add-user', function () { return view('pages.user-management.add-user'); -})->name('add-user'); \ No newline at end of file +})->name('add-user'); + +Route::get('/add-notification', function () { + return view('pages.add-notification'); +})->name('add-notification'); \ No newline at end of file