Skip to content

Commit

Permalink
Merge pull request #857 from PennyDreadfulMTG/filter-matches
Browse files Browse the repository at this point in the history
Return filtering player matches to working order
  • Loading branch information
bakert authored Nov 26, 2024
2 parents 917c8ed + 3f6c05a commit ce8084e
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions gatherling/Views/Components/AllMatchForm.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,15 @@ class AllMatchForm extends Component
public DropMenu $formatDropMenuP;
public DropMenu $seriesDropMenuP;
public DropMenu $seasonDropMenuP;
public DropMenu $oppDropMenu;
public DropMenu $oppDropMenuP;

public function __construct(Player $player, string $selectedFormat, string $selectedSeries, string $selectedSeason, string $selectedOpponent)
{
$this->formatDropMenuP = selector(opts($player->getFormatsPlayed()), 'format', '-- Format --', $selectedFormat ? $selectedFormat : '%');
$this->seriesDropMenuP = selector(opts($player->getSeriesPlayed()), 'series', '-- Series --', $selectedSeries ? $selectedSeries : '%');
$this->seasonDropMenuP = selector(opts($player->getSeasonsPlayed()), 'season', '-- Season --', $selectedSeason ? $selectedSeason : '%');
$opts = array_map(fn (array $item) => ['value' => $item['opp'], 'text' => $item['opp'] . ' [' . $item['cnt'] . ']'], $player->getOpponents());
$this->oppDropMenu = selector($opts, 'opp', '-- Opponent --', $selectedOpponent ? $selectedOpponent : '%');
$this->oppDropMenuP= selector($opts, 'opp', '-- Opponent --', $selectedOpponent ? $selectedOpponent : '%');
}
}

Expand Down
2 changes: 1 addition & 1 deletion gatherling/templates/partials/allMatchForm.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
</tr>
<tr>
<td colspan="2" class="c">
<input type="submit" name="mode" value="Filter Matches">
<input class="inputbutton" type="submit" name="mode" value="Filter Matches">
</td>
</tr>
<tr>
Expand Down
6 changes: 3 additions & 3 deletions gatherling/templates/partials/playerMatches.mustache
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{{#playerMatchForm}}
{{> playerMatchForm}}
{{/playerMatchForm}}
{{#allMatchForm}}
{{> allMatchForm}}
{{/allMatchForm}}

{{#matchTable}}
{{> matchTable}}
Expand Down

0 comments on commit ce8084e

Please sign in to comment.