From 5cb0936d40e74ffc7d06a5eda2853e034f39bfde Mon Sep 17 00:00:00 2001 From: andyksaw Date: Thu, 9 Jan 2025 09:51:50 +0900 Subject: [PATCH] Add review folder --- app/Models/BuilderRankApplication.php | 2 +- .../js/manage/Pages/Accounts/AccountList.vue | 6 + .../js/manage/Pages/Groups/GroupEdit.vue | 2 +- .../review/Layouts/Root/Partials/NavBar.vue | 64 +++++ .../review/Layouts/Root/Partials/SideBar.vue | 143 +++++++++++ .../Layouts/Root/Partials/SideBarMenuItem.vue | 83 +++++++ .../js/review/Layouts/Root/RootLayout.vue | 16 ++ resources/js/review/review.ts | 17 ++ resources/sass/review/review.scss | 5 + resources/views/review/app.blade.php | 15 ++ .../views/review/ban-appeal/index.blade.php | 48 ---- .../views/review/ban-appeal/show.blade.php | 165 ------------ .../ban-appeal/status/_decision-kv.blade.php | 28 --- .../ban-appeal/status/_denied.blade.php | 6 - .../ban-appeal/status/_pending.blade.php | 8 - .../ban-appeal/status/_tempbanned.blade.php | 6 - .../ban-appeal/status/_unbanned.blade.php | 6 - .../views/review/builder-rank/index.blade.php | 52 ---- .../views/review/builder-rank/show.blade.php | 235 ------------------ 19 files changed, 351 insertions(+), 556 deletions(-) create mode 100644 resources/js/review/Layouts/Root/Partials/NavBar.vue create mode 100644 resources/js/review/Layouts/Root/Partials/SideBar.vue create mode 100644 resources/js/review/Layouts/Root/Partials/SideBarMenuItem.vue create mode 100644 resources/js/review/Layouts/Root/RootLayout.vue create mode 100644 resources/js/review/review.ts create mode 100644 resources/sass/review/review.scss create mode 100644 resources/views/review/app.blade.php delete mode 100644 resources/views/review/ban-appeal/index.blade.php delete mode 100644 resources/views/review/ban-appeal/show.blade.php delete mode 100644 resources/views/review/ban-appeal/status/_decision-kv.blade.php delete mode 100644 resources/views/review/ban-appeal/status/_denied.blade.php delete mode 100644 resources/views/review/ban-appeal/status/_pending.blade.php delete mode 100644 resources/views/review/ban-appeal/status/_tempbanned.blade.php delete mode 100644 resources/views/review/ban-appeal/status/_unbanned.blade.php delete mode 100644 resources/views/review/builder-rank/index.blade.php delete mode 100644 resources/views/review/builder-rank/show.blade.php diff --git a/app/Models/BuilderRankApplication.php b/app/Models/BuilderRankApplication.php index 2e1fdc6cc..4662df6a9 100644 --- a/app/Models/BuilderRankApplication.php +++ b/app/Models/BuilderRankApplication.php @@ -72,7 +72,7 @@ public function status(): ApplicationStatus public function getActivitySubjectLink(): ?string { - return route('manage.builder-ranks.show', $this); + return route('review.builder-ranks.show', $this); } public function getActivitySubjectName(): ?string diff --git a/resources/js/manage/Pages/Accounts/AccountList.vue b/resources/js/manage/Pages/Accounts/AccountList.vue index 98eab8a83..c80dd2b31 100644 --- a/resources/js/manage/Pages/Accounts/AccountList.vue +++ b/resources/js/manage/Pages/Accounts/AccountList.vue @@ -83,6 +83,12 @@ watch( + +
+ + + Clear Filter + diff --git a/resources/js/manage/Pages/Groups/GroupEdit.vue b/resources/js/manage/Pages/Groups/GroupEdit.vue index 77941c445..984a7895c 100644 --- a/resources/js/manage/Pages/Groups/GroupEdit.vue +++ b/resources/js/manage/Pages/Groups/GroupEdit.vue @@ -22,7 +22,7 @@ function submit(form: InertiaForm) {
- +

Edit a Group

Groups are a collection of members with granted permissions
diff --git a/resources/js/review/Layouts/Root/Partials/NavBar.vue b/resources/js/review/Layouts/Root/Partials/NavBar.vue new file mode 100644 index 000000000..2f725f462 --- /dev/null +++ b/resources/js/review/Layouts/Root/Partials/NavBar.vue @@ -0,0 +1,64 @@ + + + diff --git a/resources/js/review/Layouts/Root/Partials/SideBar.vue b/resources/js/review/Layouts/Root/Partials/SideBar.vue new file mode 100644 index 000000000..289c66165 --- /dev/null +++ b/resources/js/review/Layouts/Root/Partials/SideBar.vue @@ -0,0 +1,143 @@ + + + diff --git a/resources/js/review/Layouts/Root/Partials/SideBarMenuItem.vue b/resources/js/review/Layouts/Root/Partials/SideBarMenuItem.vue new file mode 100644 index 000000000..8ab8a919e --- /dev/null +++ b/resources/js/review/Layouts/Root/Partials/SideBarMenuItem.vue @@ -0,0 +1,83 @@ + + + diff --git a/resources/js/review/Layouts/Root/RootLayout.vue b/resources/js/review/Layouts/Root/RootLayout.vue new file mode 100644 index 000000000..fe03da960 --- /dev/null +++ b/resources/js/review/Layouts/Root/RootLayout.vue @@ -0,0 +1,16 @@ + + + diff --git a/resources/js/review/review.ts b/resources/js/review/review.ts new file mode 100644 index 000000000..649962deb --- /dev/null +++ b/resources/js/review/review.ts @@ -0,0 +1,17 @@ +import { createApp, h } from 'vue' +import { createInertiaApp } from '@inertiajs/vue3' +import RootLayout from './Layouts/Root/RootLayout.vue' + +createInertiaApp({ + resolve: name => { + const pages = import.meta.glob('./Pages/**/*.vue', {eager: true}) + let page = pages[`./Pages/${name}.vue`] + page.default.layout = page.default.layout || RootLayout + return page + }, + setup({el, App, props, plugin}) { + createApp({render: () => h(App, props)}) + .use(plugin) + .mount(el) + }, +}) diff --git a/resources/sass/review/review.scss b/resources/sass/review/review.scss new file mode 100644 index 000000000..c30a2371d --- /dev/null +++ b/resources/sass/review/review.scss @@ -0,0 +1,5 @@ +@charset "utf-8"; + +@tailwind base; +@tailwind components; +@tailwind utilities; diff --git a/resources/views/review/app.blade.php b/resources/views/review/app.blade.php new file mode 100644 index 000000000..d3a37789b --- /dev/null +++ b/resources/views/review/app.blade.php @@ -0,0 +1,15 @@ + + + + + + @vite([ + 'resources/js/review/review.ts', + 'resources/sass/review/review.scss', + ]) + @inertiaHead + + +@inertia + + diff --git a/resources/views/review/ban-appeal/index.blade.php b/resources/views/review/ban-appeal/index.blade.php deleted file mode 100644 index 6d34ed283..000000000 --- a/resources/views/review/ban-appeal/index.blade.php +++ /dev/null @@ -1,48 +0,0 @@ -@extends('manage.layouts.admin') - -@section('title', 'Ban Appeals') - -@section('body') -
- - - - - - - - - - - - - @foreach($banAppeals as $banAppeal) - - - - - - - - - @endforeach - -
StatusPlayer NameBanning StaffAppealed AtDecided At
{{ $banAppeal->status->humanReadable() }} - - {{ $banAppeal->getBannedPlayerName() ?? 'No Alias' }} - - - - {{ $banAppeal->gamePlayerBan->bannerPlayer?->alias ?? 'No Alias' }} - - - {{ $banAppeal->created_at }} - - {{ $banAppeal->decided_at ?? '-' }} - - View -
- - {{ $banAppeals->links('vendor.pagination.bootstrap-4') }} -
-@endsection diff --git a/resources/views/review/ban-appeal/show.blade.php b/resources/views/review/ban-appeal/show.blade.php deleted file mode 100644 index 353d48956..000000000 --- a/resources/views/review/ban-appeal/show.blade.php +++ /dev/null @@ -1,165 +0,0 @@ -@extends('manage.layouts.admin') - -@section('title', 'Ban Appeal: ' . $banAppeal->getBannedPlayerName()) - -@section('body') -
-
-
-
- Appeal Details -
-
-
-
- Banned Player -
-
- - {{ $banAppeal->gamePlayerBan->bannedPlayer->alias ?? 'No Alias' }} - @if ($banAppeal->gamePlayerBan->hasNameChangedSinceBan()) - (was {{ $banAppeal->gamePlayerBan->banned_alias_at_time }}) - @endif -
- @forelse($banAppeal->gamePlayerBan->bannedPlayer->account?->groups ?? [] as $group) - - {{ $group->alias ?? Str::title($group->name) }} - - @empty - - Guest - - @endforelse -
-
-
-
- Account -
-
- @isset($banAppeal->gamePlayerBan->bannedPlayer->account) - - {{ $banAppeal->gamePlayerBan->bannedPlayer->account->username }} - - @else - Guest - @endisset - @if($banAppeal->is_account_verified) -
- - Account used to appeal -
- @else -
- - Appeal not made by this account -
- @endif -
-
- @isset($banAppeal->email) -
-
- Email -
-
- {{ $banAppeal->email }} -
-
- @endisset -
-
- Banned By -
-
- @if ($banAppeal->gamePlayerBan->bannerPlayer === null) - System - @else - - {{ $banAppeal->gamePlayerBan->bannerPlayer->alias ?? 'No Alias' }} - - @endif -
-
-
-
- Ban Expiry -
-
- {{ $banAppeal->gamePlayerBan->expires_at?->format('j M Y H:i') ?? 'Never' }} -
-
-
-
- Appeal Created -
-
- {{ $banAppeal->gamePlayerBan->created_at }} -
-
-
-
- Appeal Reason -
-
- {{ $banAppeal->explanation }} -
-
-
-
-
-
- @include('manage.pages.ban-appeal.status._' . $banAppeal->status->slug()) - - @if($banAppeal->status == \App\Domains\BanAppeals\Entities\BanAppealStatus::PENDING) -
-
- Decide Appeal -
-
- The player will be notified of - this decision immediately. -
-
-
- @csrf - @include('manage._errors') - @method('PUT') -
-
- - -
-
- - @foreach(\App\Domains\BanAppeals\Entities\BanAppealStatus::decisionCases() as $status) -
- status) == $status)> - -
- @endforeach -
-
- -
-
-
-
-
- @endif -
-
-@endsection diff --git a/resources/views/review/ban-appeal/status/_decision-kv.blade.php b/resources/views/review/ban-appeal/status/_decision-kv.blade.php deleted file mode 100644 index 7170f5c11..000000000 --- a/resources/views/review/ban-appeal/status/_decision-kv.blade.php +++ /dev/null @@ -1,28 +0,0 @@ -
-
-
- Decided At -
-
- {{ $banAppeal->decided_at }} -
-
- -
-
- Decision Reason -
-
- {{ $banAppeal->decision_note }} -
-
-
diff --git a/resources/views/review/ban-appeal/status/_denied.blade.php b/resources/views/review/ban-appeal/status/_denied.blade.php deleted file mode 100644 index f5a0f7f35..000000000 --- a/resources/views/review/ban-appeal/status/_denied.blade.php +++ /dev/null @@ -1,6 +0,0 @@ -
-
-
Denied
-
- @include('review.ban-appeal.status._decision-kv') -
diff --git a/resources/views/review/ban-appeal/status/_pending.blade.php b/resources/views/review/ban-appeal/status/_pending.blade.php deleted file mode 100644 index 07bcf8625..000000000 --- a/resources/views/review/ban-appeal/status/_pending.blade.php +++ /dev/null @@ -1,8 +0,0 @@ -
-
-
Awaiting Decision
-
-
-

Please discuss this ban appeal in Discord.
Once a consensus has been reached, select the decision below

-
-
diff --git a/resources/views/review/ban-appeal/status/_tempbanned.blade.php b/resources/views/review/ban-appeal/status/_tempbanned.blade.php deleted file mode 100644 index a9bab5ec6..000000000 --- a/resources/views/review/ban-appeal/status/_tempbanned.blade.php +++ /dev/null @@ -1,6 +0,0 @@ -
-
-
Banned for {{ $banAppeal->getDecisionTempbanDuration() }}
-
- @include('manage.pages.ban-appeal.status._decision-kv') -
diff --git a/resources/views/review/ban-appeal/status/_unbanned.blade.php b/resources/views/review/ban-appeal/status/_unbanned.blade.php deleted file mode 100644 index ec002221b..000000000 --- a/resources/views/review/ban-appeal/status/_unbanned.blade.php +++ /dev/null @@ -1,6 +0,0 @@ -
-
-
Unbanned
-
- @include('manage.pages.ban-appeal.status._decision-kv') -
diff --git a/resources/views/review/builder-rank/index.blade.php b/resources/views/review/builder-rank/index.blade.php deleted file mode 100644 index 7e8aca0d7..000000000 --- a/resources/views/review/builder-rank/index.blade.php +++ /dev/null @@ -1,52 +0,0 @@ -@extends('manage.layouts.admin') - -@section('title', 'Builder Rank Applications') - -@section('body') -
- - - - - - - - - - - - - - @foreach($applications as $application) - - - - - - - - - - @endforeach - -
StatusAccountMinecraft UsernameCurrent RankCreated AtReviewed At
{{ \App\Domains\BuilderRankApplications\Data\ApplicationStatus::from($application->status)->humanReadable() }} - - {{ $application->account->username ?: 'Undefined' }} - - {{ $application->minecraft_alias }}{{ $application->current_builder_rank }}{{ $application->created_at }}{{ $application->closed_at ?: '(Not Reviewed)' }} - @if ($application->isReviewed()) - - View - - @else - - Review - - @endif - -
- - {{ $applications->links('vendor.pagination.bootstrap-4') }} -
-@endsection diff --git a/resources/views/review/builder-rank/show.blade.php b/resources/views/review/builder-rank/show.blade.php deleted file mode 100644 index 1448afe71..000000000 --- a/resources/views/review/builder-rank/show.blade.php +++ /dev/null @@ -1,235 +0,0 @@ -@extends('manage.layouts.admin') - -@section('title', 'Rank Application: ' . $application->account->username) - -@section('toolbar') - - View as Submitter - -@endsection - -@section('body') -
-
- @include('manage._errors') - - @if ($application->status == \App\Domains\BuilderRankApplications\Data\ApplicationStatus::IN_PROGRESS->value) -
-
- Application Status -
- -
-
Awaiting Decision
-

- Please discuss the submission in Discord.
- Once a decision has been reached, click the approve or deny button to complete this - application. -

- Opened {{ $application->created_at->diffForHumans() }} -

-
-
- @endif - @if ($application->status == \App\Domains\BuilderRankApplications\Data\ApplicationStatus::DENIED->value) -
-
- Application Status -
- -
-
Application Denied
-

- This application was denied for the following reason:
- {{ $application->denied_reason }} -

- Closed {{ $application->closed_at }} -

-
-
- @endif - @if ($application->status == \App\Domains\BuilderRankApplications\Data\ApplicationStatus::APPROVED->value) -
-
- Application Status -
- -
-
Application Approved
-

- This application was approved -

- Closed {{ $application->closed_at }} -

-
-
- @endif - -
-
- Submission -
-
- -
-
- Minecraft username -
-
- {{ $application->minecraft_alias }} -
-
-
-
- Current build rank -
-
- {{ $application->current_builder_rank }} -
-
-
-
- Build location -
-
- {{ $application->build_location }} -
-
-
-
- Build description -
-
- {{ $application->build_description }} -
-
-
-
- Additional notes -
-
- {{ $application->additional_notes ?: 'None' }} -
-
-
-
- Created at -
-
- {{ $application->created_at }} -
-
- @if ($application->updated_at != $application->created_at) -
-
- Updated at -
-
- {{ $application->updated_at }} -
-
- @endif -
-
-
-
-
-
- Close Application -
- - @if ($application->status == \App\Domains\BuilderRankApplications\Data\ApplicationStatus::IN_PROGRESS->value) -
    -
  • - -
  • -
  • - -
  • -
- @else -
- No further action can be taken -
- @endif - - -
-
-
- - -
- @csrf - -
- -
- @csrf - -
-@endsection