Skip to content

Commit

Permalink
Fix displaying tag team partner names
Browse files Browse the repository at this point in the history
  • Loading branch information
JeffreyDavidson committed Dec 25, 2023
1 parent c1be00d commit 0a993cc
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 14 deletions.
23 changes: 10 additions & 13 deletions resources/views/livewire/tag-teams/tag-teams-list.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,7 @@ class="min-w-125px sorting">Status
multi-column
wire:click="sortBy('wrestlerA')"
:direction="$sorts['wrestlerA'] ?? null"
class="min-w-125px sorting">Tag Team Partner
</x-table.heading>
<x-table.heading
sortable
multi-column
wire:click="sortBy('wrestlerB')"
:direction="$sorts['wrestlerB'] ?? null"
class="min-w-125px sorting">Tag Team Partner
class="min-w-125px sorting">Current Tag Team Partners
</x-table.heading>
<x-table.heading
sortable
Expand Down Expand Up @@ -77,11 +70,15 @@ class="mb-1 text-gray-800 text-hover-primary"
</x-table.cell>

<x-table.cell>
<div>{{ $tagTeam->currentWrestlers->first()->name ?? 'No wrestler chosen' }}</div>
</x-table.cell>

<x-table.cell>
<div>{{ $tagTeam->currentWrestlers->last()->name ?? 'No wrestler chosen' }}</div>
@if ($tagTeam->currentWrestlers->isNotEmpty())
@if ($tagTeam->currentWrestlers->count() === 2)
<div>{{ $tagTeam->currentWrestlers->pluck('name')->join(', ', ' and ') }}</div>
@else
<div>{{ $tagTeam->currentWrestlers->first()->name }} and TBD</div>
@endif
@else
<div>No Wrestlers Assigned</div>
@endif
</x-table.cell>

<x-table.cell>
Expand Down
13 changes: 12 additions & 1 deletion resources/views/tag-teams/show.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,18 @@
<x-separator />
<x-card.detail-container id="kt_tag_team_view_details">
<x-card.detail-row property="Name" value="{{ $tagTeam->name }}" />
<x-card.detail-row property="Tag Team Partners" value="{{ $tagTeam->currentWrestlers->isNotEmpty() ? $tagTeam->currentWrestlers->pluck('name')->join(', ', ' and ') : 'No Wrestlers Assigned' }}" />
@php
if ($tagTeam->currentWrestlers->isNotEmpty()) {
if ($tagTeam->currentWrestlers->count() === 2) {
$names = $tagTeam->currentWrestlers->pluck('name')->join(', ', ' and ');
} else {
$names = $tagTeam->currentWrestlers->first()->name. " and TBD";
}
} else {
$names = "No Wrestlers Assigned";
}
@endphp
<x-card.detail-row property="Current Tag Team Partners" value="{{ $names }}" />

@if ($tagTeam->currentWrestlers->isNotEmpty())
<x-card.detail-row property="Combined Weight" value="{{ $tagTeam->combined_weight }} lbs." />
Expand Down

0 comments on commit 0a993cc

Please sign in to comment.