Skip to content

Commit

Permalink
Fix bug referring to player which is no longer passed to template
Browse files Browse the repository at this point in the history
  • Loading branch information
bakert committed Nov 26, 2024
1 parent f06590a commit 139e493
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
2 changes: 2 additions & 0 deletions gatherling/Views/Components/EntryListItem.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ class EntryListItem
{
public int $dropRound;
public string $eventName;
public string $playerName;
public ?string $emailAddress;
public bool $canDrop = false;
public bool $canUndrop = false;
Expand All @@ -35,6 +36,7 @@ public function __construct(Entry $entry, int $numEntries, public bool $isTribal
{
$this->dropRound = $entry->drop_round;
$this->eventName = $entry->event->name;
$this->playerName = $entry->player->name;
$this->emailAddress = $entry->player->emailAddress;
if ($entry->event->active == 1) {
$playerActive = Standings::playerActive($entry->event->name, $entry->player->name);
Expand Down
8 changes: 4 additions & 4 deletions gatherling/templates/partials/entryListItem.mustache
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<tr id="entry_row_{{player.name}}">
<tr id="entry_row_{{playerName}}">
{{#canDrop}}
<td class="c">
<input type="checkbox" name="dropplayer[]" value="{{player.name}}">
<input type="checkbox" name="dropplayer[]" value="{{playerName}}">
</td>
{{/canDrop}}
{{#canUndrop}}
Expand All @@ -20,7 +20,7 @@
{{#gameName}}{{> gameName}}{{/gameName}}
{{/emailAddress}}
{{#emailAddress}}
<a class="emailPop" title="{{player.emailAddress}}">{{#gameName}}{{> gameName}}{{/gameName}}</a>
<a class="emailPop" title="{{emailAddress}}">{{#gameName}}{{> gameName}}{{/gameName}}</a>
{{/emailAddress}}
</td>
<td>
Expand Down Expand Up @@ -52,7 +52,7 @@
</td>
<td class="c">
{{#canDelete}}
<input type="checkbox" name="delentries[]" value="{{player.name}}">
<input type="checkbox" name="delentries[]" value="{{playerName}}">
{{/canDelete}}
{{#notAllowed}}
{{> notAllowed}}
Expand Down

0 comments on commit 139e493

Please sign in to comment.