Skip to content

Commit

Permalink
fix: define $artists
Browse files Browse the repository at this point in the history
  • Loading branch information
ScuffedNewt committed Sep 18, 2024
1 parent 0d14806 commit 1599ee3
Show file tree
Hide file tree
Showing 11 changed files with 11 additions and 8 deletions.
2 changes: 1 addition & 1 deletion app/Http/Controllers/Admin/Data/ItemController.php
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ public function getItemIndex(Request $request) {
return view('admin.items.items', [
'items' => $query->paginate(20)->appends($request->query()),
'categories' => ['none' => 'Any Category'] + ItemCategory::orderBy('sort', 'DESC')->pluck('name', 'id')->toArray(),
'artists' => ['none' => 'Any Artist'] + User::whereIn('id', Item::whereNotNull('artist_id')->pluck('artist_id')->toArray())->pluck('name', 'id')->toArray(),
'artists' => User::whereIn('id', Item::whereNotNull('artist_id')->pluck('artist_id')->toArray())->pluck('name', 'id')->toArray(),
]);
}

Expand Down
1 change: 1 addition & 0 deletions app/Http/Controllers/Characters/CharacterController.php
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,7 @@ public function getCharacterInventory(Request $request, $slug) {
'categories' => $categories->keyBy('id'),
'items' => $items,
'logs' => $this->character->getItemLogs(),
'artists' => User::whereIn('id', Item::whereNotNull('artist_id')->pluck('artist_id')->toArray())->pluck('name', 'id')->toArray(),
] + (Auth::check() && (Auth::user()->hasPower('edit_inventories') || Auth::user()->id == $this->character->user_id) ? [
'itemOptions' => $itemOptions->pluck('name', 'id'),
'userInventory' => UserItem::with('item')->whereIn('item_id', $itemOptions->pluck('id'))->whereNull('deleted_at')->where('count', '>', '0')->where('user_id', Auth::user()->id)->get()->filter(function ($userItem) {
Expand Down
1 change: 1 addition & 0 deletions app/Http/Controllers/Users/InventoryController.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ public function getIndex(Request $request) {
'items' => $items,
'userOptions' => User::visible()->where('id', '!=', Auth::user()->id)->orderBy('name')->pluck('name', 'id')->toArray(),
'user' => Auth::user(),
'artists' => ['none' => 'Any Artist'] + User::whereIn('id', Item::whereNotNull('artist_id')->pluck('artist_id')->toArray())->pluck('name', 'id')->toArray(),
]);
}

Expand Down
1 change: 1 addition & 0 deletions app/Http/Controllers/Users/UserController.php
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,7 @@ public function getUserInventory(Request $request, $name) {
'userOptions' => User::where('id', '!=', $this->user->id)->orderBy('name')->pluck('name', 'id')->toArray(),
'user' => $this->user,
'logs' => $this->user->getItemLogs(),
'artists' => User::whereIn('id', Item::whereNotNull('artist_id')->pluck('artist_id')->toArray())->pluck('name', 'id')->toArray(),
]);
}

Expand Down
2 changes: 1 addition & 1 deletion app/Http/Controllers/WorldController.php
Original file line number Diff line number Diff line change
Expand Up @@ -409,7 +409,7 @@ public function getItems(Request $request) {
'items' => $query->orderBy('id')->paginate(20)->appends($request->query()),
'categories' => ['none' => 'Any Category'] + ['withoutOption' => 'Without Category'] + ItemCategory::visible(Auth::user() ?? null)->orderBy('sort', 'DESC')->pluck('name', 'id')->toArray(),
'shops' => Shop::orderBy('sort', 'DESC')->get(),
'artists' => ['none' => 'Any Artist'] + User::whereIn('id', Item::whereNotNull('artist_id')->pluck('artist_id')->toArray())->pluck('name', 'id')->toArray(),
'artists' => User::whereIn('id', Item::whereNotNull('artist_id')->pluck('artist_id')->toArray())->pluck('name', 'id')->toArray(),
]);
}

Expand Down
2 changes: 1 addition & 1 deletion config/lorekeeper/extensions.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@

// Item Entry Expansion - Mercury
'item_entry_expansion' => [
'extra_fields' => 0,
'extra_fields' => 1,
'resale_function' => 0,
'loot_tables' => [
// Adds the ability to use either rarity criteria for items or item categories with rarity criteria in loot tables. Note that disabling this does not apply retroactively.
Expand Down
2 changes: 1 addition & 1 deletion resources/views/admin/items/items.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
</div>
@if (config('lorekeeper.extensions.item_entry_expansion.extra_fields'))
<div class="form-group ml-3 mb-3">
{!! Form::select('artist', $artists, Request::get('artist'), ['class' => 'form-control']) !!}
{!! Form::select('artist', $artists, Request::get('artist'), ['class' => 'form-control', 'placeholder' => 'Any Artist']) !!}
</div>
@endif
</div>
Expand Down
2 changes: 1 addition & 1 deletion resources/views/character/inventory.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
</div>
@if (config('lorekeeper.extensions.item_entry_expansion.extra_fields'))
<div class="form-group ml-3 mb-3">
{!! Form::select('artist', $artists, Request::get('artist'), ['class' => 'form-control']) !!}
{!! Form::select('artist', $artists, Request::get('artist'), ['class' => 'form-control', 'placeholder' => 'Any Artist']) !!}
</div>
@endif
<div class="form-group ml-3 mb-3">
Expand Down
2 changes: 1 addition & 1 deletion resources/views/home/inventory.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
</div>
@if (config('lorekeeper.extensions.item_entry_expansion.extra_fields'))
<div class="form-group ml-3 mb-3">
{!! Form::select('artist', $artists, Request::get('artist'), ['class' => 'form-control']) !!}
{!! Form::select('artist', $artists, Request::get('artist'), ['class' => 'form-control', 'placeholder' => 'Any Artist']) !!}
</div>
@endif
<div class="form-group ml-3 mb-3">
Expand Down
2 changes: 1 addition & 1 deletion resources/views/user/inventory.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
</div>
@if (config('lorekeeper.extensions.item_entry_expansion.extra_fields'))
<div class="form-group ml-3 mb-3">
{!! Form::select('artist', $artists, Request::get('artist'), ['class' => 'form-control']) !!}
{!! Form::select('artist', $artists, Request::get('artist'), ['class' => 'form-control', 'placeholder' => 'Any Artist']) !!}
</div>
@endif
<div class="form-group ml-3 mb-3">
Expand Down
2 changes: 1 addition & 1 deletion resources/views/world/items.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
</div>
@if (config('lorekeeper.extensions.item_entry_expansion.extra_fields'))
<div class="form-group ml-3 mb-3">
{!! Form::select('artist', $artists, Request::get('artist'), ['class' => 'form-control']) !!}
{!! Form::select('artist', $artists, Request::get('artist'), ['class' => 'form-control', 'placeholder' => 'Any Artist']) !!}
</div>
@endif
</div>
Expand Down

0 comments on commit 1599ee3

Please sign in to comment.