diff --git a/dist/app/Http/Controllers/Web/Admin/Tools/GameNewsController.php b/dist/app/Http/Controllers/Web/Admin/Tools/GameNewsController.php index 2e89744..2c96ccc 100644 --- a/dist/app/Http/Controllers/Web/Admin/Tools/GameNewsController.php +++ b/dist/app/Http/Controllers/Web/Admin/Tools/GameNewsController.php @@ -44,7 +44,7 @@ public function submit(News $news, SubmitGameNewsRequest $request) { $this->updateNews($news, $request); break; case HttpMethod::DELETE: - $this->deleteNews($news, $request); + $this->deleteNews($news); break; default: } @@ -85,9 +85,10 @@ protected function updateNews(News &$news, SubmitGameNewsRequest &$request) return Redirect::back(); } - protected function deleteNews(News &$news, SubmitGameNewsRequest &$request) + protected function deleteNews(News &$news) { - + $news->delete(); + return Redirect::back(); } } diff --git a/dist/package-lock.json b/dist/package-lock.json index 9e06fa7..e101fff 100644 --- a/dist/package-lock.json +++ b/dist/package-lock.json @@ -8,7 +8,9 @@ "@inertiajs/vue3": "^1.0.14", "@vitejs/plugin-vue": "^5.0.3", "alpinejs": "^3.13.7", - "dotenv": "^16.4.2" + "dotenv": "^16.4.2", + "jquery": "^3.7.1", + "jquery-modal": "^0.9.2" }, "devDependencies": { "autoprefixer": "^10.4.17", @@ -1842,6 +1844,16 @@ "jiti": "bin/jiti.js" } }, + "node_modules/jquery": { + "version": "3.7.1", + "resolved": "https://registry.npmjs.org/jquery/-/jquery-3.7.1.tgz", + "integrity": "sha512-m4avr8yL8kmFN8psrbFFFmB/If14iN5o9nw/NgnnM+kybDJpRsAynV2BsfpTYrTRysYUdADVD7CkUUizgkpLfg==" + }, + "node_modules/jquery-modal": { + "version": "0.9.2", + "resolved": "https://registry.npmjs.org/jquery-modal/-/jquery-modal-0.9.2.tgz", + "integrity": "sha512-Bx6jTBuiUbdywriWd0UAZK9v7FKEDCOD5uRh47qd4coGvx+dG4w8cOGe4TG2OoR1dNrXn6Aqaeu8MAA+Oz7vOw==" + }, "node_modules/kvparser": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/kvparser/-/kvparser-1.0.2.tgz", diff --git a/dist/package.json b/dist/package.json index fba7882..90ebb83 100644 --- a/dist/package.json +++ b/dist/package.json @@ -20,6 +20,8 @@ "@inertiajs/vue3": "^1.0.14", "@vitejs/plugin-vue": "^5.0.3", "alpinejs": "^3.13.7", - "dotenv": "^16.4.2" + "dotenv": "^16.4.2", + "jquery": "^3.7.1", + "jquery-modal": "^0.9.2" } } diff --git a/dist/resources/css/app.scss b/dist/resources/css/app.scss index 653de62..eee1dd5 100644 --- a/dist/resources/css/app.scss +++ b/dist/resources/css/app.scss @@ -2,4 +2,5 @@ @tailwind components; @tailwind utilities; -@import "inputs-global"; \ No newline at end of file +@import "inputs-global"; +@import "modal"; \ No newline at end of file diff --git a/dist/resources/css/modal.scss b/dist/resources/css/modal.scss new file mode 100644 index 0000000..b245ecd --- /dev/null +++ b/dist/resources/css/modal.scss @@ -0,0 +1,10 @@ +@import 'jquery-modal'; + +.modal { + @apply bg-slate-800 shadow-glow shadow-gray-800/50; + + .close-modal { + @apply border-slate-800 border-2 rounded-full; + } +} + diff --git a/dist/resources/js/bootstrap.js b/dist/resources/js/bootstrap.js index 66feed3..62f767a 100644 --- a/dist/resources/js/bootstrap.js +++ b/dist/resources/js/bootstrap.js @@ -3,10 +3,10 @@ * to our Laravel back-end. This library automatically handles sending the * CSRF token as a header based on the value of the "XSRF" token cookie. */ -import { createApp, h } from 'vue' - +import modal from 'jquery-modal'; import axios from 'axios'; import Alpine from 'alpinejs'; +import jQuery from 'jquery'; window.axios = axios; window.axios.defaults.headers.common['X-Requested-With'] = 'XMLHttpRequest'; @@ -14,6 +14,12 @@ window.axios.defaults.headers.common['X-Requested-With'] = 'XMLHttpRequest'; window.Alpine = Alpine; Alpine.start(); +window.$ = window.jQuery = jQuery(); +window.$.modal = modal; +windows.$("#custom-close").modal({ + closeClass: 'modal-close-custom', +}) + /** diff --git a/dist/resources/views/components/admin/tools/game-news-list-entry.blade.php b/dist/resources/views/components/admin/tools/game-news-list-entry.blade.php index 91e4946..b52df97 100644 --- a/dist/resources/views/components/admin/tools/game-news-list-entry.blade.php +++ b/dist/resources/views/components/admin/tools/game-news-list-entry.blade.php @@ -18,7 +18,7 @@ redirectMode: '{{ $news->redirect_mode->value }}' }" > -
diff --git a/dist/resources/views/components/inputs/button.blade.php b/dist/resources/views/components/inputs/button.blade.php index fc5b253..da91970 100644 --- a/dist/resources/views/components/inputs/button.blade.php +++ b/dist/resources/views/components/inputs/button.blade.php @@ -1,5 +1,22 @@ +@php + /** @var \Illuminate\View\ComponentAttributeBag $attributes */ + + $addAnchorTagForModal = $attributes->has('rel') && str_contains($attributes->get('rel'), 'modal'); +@endphp + @props([ 'type' => 'submit' ]) - \ No newline at end of file +@if($addAnchorTagForModal) + +@endif + + + +@if($attributes) + +@endif \ No newline at end of file diff --git a/dist/routes/admin.php b/dist/routes/admin.php index c686d3b..16a0823 100644 --- a/dist/routes/admin.php +++ b/dist/routes/admin.php @@ -18,7 +18,6 @@ Route::post('gamenews/create', [GameNewsController::class, 'create'])->name('gamenews.create'); Route::post('gamenews/{news}', [GameNewsController::class, 'submit'])->name('gamenews.post'); - Route::fallback(function () { return redirect(route('admin.dashboard')); });