diff --git a/dist/app/Http/Controllers/Web/Admin/Tools/GameNewsController.php b/dist/app/Http/Controllers/Web/Admin/Tools/GameNewsController.php index 0c989e7..de5f111 100644 --- a/dist/app/Http/Controllers/Web/Admin/Tools/GameNewsController.php +++ b/dist/app/Http/Controllers/Web/Admin/Tools/GameNewsController.php @@ -23,4 +23,8 @@ public function index() return view('admin.tools.game-news', ['newsList' => $news]); } + + public function put() { + + } } diff --git a/dist/app/Models/Game/Messages/News.php b/dist/app/Models/Game/Messages/News.php index 4c1fed6..43608ee 100644 --- a/dist/app/Models/Game/Messages/News.php +++ b/dist/app/Models/Game/Messages/News.php @@ -9,6 +9,7 @@ use Illuminate\Database\Eloquent\Concerns\HasUuids; use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; +use Illuminate\Support\Carbon; /** * @mixin IdeHelperNews @@ -21,5 +22,7 @@ class News extends Model 'message_type' => MessageType::class, 'redirect_mode' => GameNewsRedirectMode::class, 'faction' => Faction::class, + 'from_date' => 'datetime:Y-m-d H:i:s', + 'to_date' => 'datetime:Y-m-d H:i:s', ]; } diff --git a/dist/app/View/Components/Admin/Tools/GameNewsListEntry.php b/dist/app/View/Components/Admin/Tools/GameNewsListEntry.php index 0a4e03a..606f4d9 100644 --- a/dist/app/View/Components/Admin/Tools/GameNewsListEntry.php +++ b/dist/app/View/Components/Admin/Tools/GameNewsListEntry.php @@ -9,13 +9,18 @@ class GameNewsListEntry extends Component { + public string $idPrefix; + /** * Create a new component instance. */ public function __construct( - public News $news + public News $news, + ?string $idPrefix = null, ) - {} + { + $this->idPrefix = $idPrefix === null ? '' : $idPrefix.'_'; + } /** * Get the view / contents that represent the component. diff --git a/dist/resources/css/inputs-global.scss b/dist/resources/css/inputs-global.scss index 965b530..337fde3 100644 --- a/dist/resources/css/inputs-global.scss +++ b/dist/resources/css/inputs-global.scss @@ -1,5 +1,9 @@ +[class^='input-global-'] { + @apply transition-colors rounded-md border bg-gray-800 border-gray-600; +} + .input-global-text { - @apply rounded-md border border-gray-600 bg-gray-800 px-4 py-2 text-base outline-none focus-within:border-indigo-600 whitespace-nowrap; + @apply px-4 py-2 text-base outline-none focus-within:border-indigo-600 whitespace-nowrap; flex-grow: 1; input { @@ -23,7 +27,7 @@ } .input-global-textarea { - @apply px-4 py-2 rounded-md bg-gray-800 border-gray-600 border w-auto outline-none focus-within:border-indigo-600 resize-y text-nowrap; + @apply px-4 py-2 w-auto outline-none focus-within:border-indigo-600 resize-y text-nowrap; flex-grow: 1; } @@ -32,9 +36,33 @@ } .input-global-dropdown { - @apply rounded-md border border-gray-600 bg-gray-800 px-4 py-2 text-base outline-none focus:border-indigo-600; + @apply px-4 py-2 text-base outline-none focus:border-indigo-600; option { - @apply bg-gray-800 px-4 py-2 rounded-sm; + @apply px-4 py-2 rounded-sm; + } +} + +.input-global-date { + @apply px-4 py-2 text-base outline-none focus:border-indigo-600; +} + +.input-global-number { + @apply px-4 py-2 text-base outline-none focus:border-indigo-600; +} + +.input-global-submit { + @apply px-4 py-2 text-base outline-none focus:border-indigo-600 hover:bg-gray-600; + + &.save { + @apply bg-blue-800 border-blue-600 hover:bg-blue-600; + } + + &.delete { + @apply bg-rose-800 border-rose-600 hover:bg-rose-600; + } + + &.create { + @apply bg-green-800 border-green-600 hover:bg-green-600; } } diff --git a/dist/resources/views/admin/tools/game-news.blade.php b/dist/resources/views/admin/tools/game-news.blade.php index 31e43db..2ad8131 100644 --- a/dist/resources/views/admin/tools/game-news.blade.php +++ b/dist/resources/views/admin/tools/game-news.blade.php @@ -3,7 +3,7 @@ ]) -
+
@foreach($newsList as $news) @endforeach 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 c7ebfb5..4960099 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 @@ -4,75 +4,101 @@ use App\Enums\Game\Faction; use App\Enums\Game\Message\GameNewsRedirectMode; /** @var News $news */ + /** @var string $idPrefix */ @endphp @pushonce('head') @vite(['resources/css/components/admin/tools/game-news-list-entry.scss']) @endpushonce -
-
-
- - +
+
+ @csrf +
+
+ + +
+
+ + {{ $news->body }} +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
-
- - {{ $news->body }} +
+ Stuff + Save + Delete + Create
-
- - -
-
- - -
-
- - -
-
- - -
-
- - -
-
- - -
-
- - -
-
- - -
-
- - -
-
- - -
-
- - -
-
+
diff --git a/dist/resources/views/components/inputs/date.blade.php b/dist/resources/views/components/inputs/date.blade.php new file mode 100644 index 0000000..13a9477 --- /dev/null +++ b/dist/resources/views/components/inputs/date.blade.php @@ -0,0 +1 @@ +merge(['class' => 'input-global-date']) }}> \ No newline at end of file diff --git a/dist/resources/views/components/inputs/number.blade.php b/dist/resources/views/components/inputs/number.blade.php new file mode 100644 index 0000000..21d0a49 --- /dev/null +++ b/dist/resources/views/components/inputs/number.blade.php @@ -0,0 +1 @@ +merge(['class' => 'input-global-number']) }}> \ No newline at end of file diff --git a/dist/resources/views/components/inputs/submit.blade.php b/dist/resources/views/components/inputs/submit.blade.php new file mode 100644 index 0000000..804331f --- /dev/null +++ b/dist/resources/views/components/inputs/submit.blade.php @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/dist/routes/admin.php b/dist/routes/admin.php index a29b392..632c20d 100644 --- a/dist/routes/admin.php +++ b/dist/routes/admin.php @@ -15,7 +15,7 @@ Route::post('file-manager', [GameFileController::class, 'store'])->name('file.store'); Route::get('gamenews', [GameNewsController::class, 'index'])->name(GameNewsController::class); - +Route::post('gamenews/{newsId}', [GameNewsController::class, 'put'])->name('gamenews.post'); Route::fallback(function () {