Skip to content

Commit 343035e

Browse files
ScuffedNewtNe-wt
andauthored
feat: resolve standing issues (#735)
* fix issue #728 * fix #96 * fix #113 * Update birthday selector on register * fix #225 * fix #226 * fix #346 * fix #558 * fix #460 * fix #459 * fix #91 * Apply fixes from #91 to prompt submissions * refactor: fix blade formatting * remove character item retention due to return input wackiness * refactor: fix PHP styling * array_unique on slugs for gallery * add missing set active on user sidebars * add comment history and bugfix for likes * refactor: fix blade formatting * tweak function docs and sales comments checks * refactor: fix blade formatting * Capitalise 'carbon' in UserService * refactor: fix PHP styling --------- Co-authored-by: Ne-wt <Ne-wt@users.noreply.github.com>
1 parent 42ef535 commit 343035e

File tree

63 files changed

+761
-216
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

63 files changed

+761
-216
lines changed

app/Console/Commands/UpdateCommentTypes.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
namespace App\Console\Commands;
44

5-
use App\Models\Comment;
5+
use App\Models\Comment\Comment;
66
use Illuminate\Console\Command;
77

88
class UpdateCommentTypes extends Command {

app/Console/Commands/UpdateLorekeeperV2.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
namespace App\Console\Commands;
44

5-
use App\Models\Comment;
5+
use App\Models\Comment\Comment;
66
use Illuminate\Console\Command;
77

88
class UpdateLorekeeperV2 extends Command {

app/Events/CommentCreated.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
namespace App\Events;
44

5-
use App\Models\Comment;
5+
use App\Models\Comment\Comment;
66
use Illuminate\Queue\SerializesModels;
77

88
class CommentCreated {

app/Events/CommentDeleted.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
namespace App\Events;
44

5-
use App\Models\Comment;
5+
use App\Models\Comment\Comment;
66
use Illuminate\Queue\SerializesModels;
77

88
class CommentDeleted {

app/Events/CommentUpdated.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
namespace App\Events;
44

5-
use App\Models\Comment;
5+
use App\Models\Comment\Comment;
66
use Illuminate\Queue\SerializesModels;
77

88
class CommentUpdated {

app/Http/Controllers/Admin/Characters/CharacterController.php

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -561,9 +561,22 @@ public function postMyoTransfer(Request $request, CharacterManager $service, $id
561561
*
562562
* @return \Illuminate\Contracts\Support\Renderable
563563
*/
564-
public function getTransferQueue($type) {
564+
public function getTransferQueue(Request $request, $type) {
565565
$transfers = CharacterTransfer::query();
566566
$user = Auth::user();
567+
$data = $request->only(['sort']);
568+
if (isset($data['sort'])) {
569+
switch ($data['sort']) {
570+
case 'newest':
571+
$transfers->sortNewest();
572+
break;
573+
case 'oldest':
574+
$transfers->sortOldest();
575+
break;
576+
}
577+
} else {
578+
$transfers->sortOldest();
579+
}
567580

568581
if ($type == 'completed') {
569582
$transfers->completed();

app/Http/Controllers/Admin/Data/FeatureController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ public function postSortFeatureCategory(Request $request, FeatureService $servic
164164
*/
165165
public function getFeatureIndex(Request $request) {
166166
$query = Feature::query();
167-
$data = $request->only(['rarity_id', 'feature_category_id', 'species_id', 'name']);
167+
$data = $request->only(['rarity_id', 'feature_category_id', 'species_id', 'subtype_id', 'name']);
168168
if (isset($data['rarity_id']) && $data['rarity_id'] != 'none') {
169169
$query->where('rarity_id', $data['rarity_id']);
170170
}

app/Http/Controllers/Admin/DesignController.php

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,19 @@ class DesignController extends Controller {
2020
*/
2121
public function getDesignIndex(Request $request, $type, $status) {
2222
$requests = CharacterDesignUpdate::where('status', ucfirst($status));
23+
$data = $request->only(['sort']);
24+
if (isset($data['sort'])) {
25+
switch ($data['sort']) {
26+
case 'newest':
27+
$requests->sortNewest();
28+
break;
29+
case 'oldest':
30+
$requests->sortOldest();
31+
break;
32+
}
33+
} else {
34+
$requests->sortOldest();
35+
}
2336
if ($type == 'myo-approvals') {
2437
$requests = $requests->myos();
2538
} else {

app/Http/Controllers/Admin/GalleryController.php

Lines changed: 32 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,24 @@ class GalleryController extends Controller {
2121
*/
2222
public function getSubmissionIndex(Request $request, $status = null) {
2323
$submissions = GallerySubmission::collaboratorApproved()->where('status', $status ? ucfirst($status) : 'Pending');
24-
if ($request->get('gallery_id')) {
25-
$submissions->where(function ($query) use ($request) {
26-
$query->where('gallery_id', $request->get('gallery_id'));
24+
$data = $request->only(['gallery_id', 'sort']);
25+
if (isset($data['gallery_id'])) {
26+
$submissions->where(function ($query) use ($data) {
27+
$query->where('gallery_id', $data['gallery_id']);
2728
});
2829
}
30+
if (isset($data['sort'])) {
31+
switch ($data['sort']) {
32+
case 'newest':
33+
$submissions->sortNewest();
34+
break;
35+
case 'oldest':
36+
$submissions->sortOldest();
37+
break;
38+
}
39+
} else {
40+
$submissions->sortOldest();
41+
}
2942
if ($status == 'pending' || !$status) {
3043
$submissions = $submissions->orderBy('created_at', 'ASC');
3144
} else {
@@ -47,11 +60,24 @@ public function getSubmissionIndex(Request $request, $status = null) {
4760
*/
4861
public function getCurrencyIndex(Request $request, $status = null) {
4962
$submissions = GallerySubmission::requiresAward()->where('is_valued', !$status || $status == 'pending' ? 0 : 1);
50-
if ($request->get('gallery_id')) {
51-
$submissions->where(function ($query) use ($request) {
52-
$query->where('gallery_id', $request->get('gallery_id'));
63+
$data = $request->only(['gallery_id', 'sort']);
64+
if (isset($data['gallery_id'])) {
65+
$submissions->where(function ($query) use ($data) {
66+
$query->where('gallery_id', $data['gallery_id']);
5367
});
5468
}
69+
if (isset($data['sort'])) {
70+
switch ($data['sort']) {
71+
case 'newest':
72+
$submissions->sortNewest();
73+
break;
74+
case 'oldest':
75+
$submissions->sortOldest();
76+
break;
77+
}
78+
} else {
79+
$submissions->sortOldest();
80+
}
5581
if ($status == 'pending' || !$status) {
5682
$submissions = $submissions->orderBy('created_at', 'ASC');
5783
} else {

app/Http/Controllers/Admin/ReportController.php

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,22 @@ public function getReportIndex(Request $request, $status = null) {
2222
} else {
2323
$reports = Report::where('status', $status ? ucfirst($status) : 'Pending');
2424
}
25+
$data = $request->only(['sort']);
26+
if (isset($data['sort'])) {
27+
switch ($data['sort']) {
28+
case 'newest':
29+
$reports->sortNewest();
30+
break;
31+
case 'oldest':
32+
$reports->sortOldest();
33+
break;
34+
case 'bug':
35+
$reports->whereNotNull('error_type');
36+
break;
37+
}
38+
} else {
39+
$reports->sortOldest();
40+
}
2541

2642
return view('admin.reports.index', [
2743
'reports' => $reports->orderBy('id', 'DESC')->paginate(30)->appends($request->query()),

0 commit comments

Comments
 (0)