Skip to content

Commit 1666a76

Browse files
authored
Merge pull request #373 from CnCNet/bugfix/gamereport-link-in-admin-tools
Fixed ladder game report link.
2 parents 341ce16 + b94c59b commit 1666a76

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

cncnet-api/resources/views/components/ladder/listing/game-box.blade.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
@php
33
$mapName = $game->qmMatch?->map?->description;
44
@endphp
5-
<a href="{{ '/ladder/' . $history->short . '/' . $history->ladder->abbreviation . '/games/' . $game->id }}" class="game-box"
5+
<a href="{{ route('ladder.game', ['date' => $history->short, 'game' => $history->ladder->abbreviation, 'gameId' => $game->id]) }}" class="game-box"
66
data-timestamp="{{ $game->updated_at->timestamp }}">
77

88
<div class="map-preview">

cncnet-api/resources/views/ladders/game/_admin-game-tools.blade.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@
7070
@if ($k == 0)
7171
@if ($userIsMod && $thisGameReport->id != $gameReport->id)
7272
<a class="btn btn-outline-secondary"
73-
href="{{ action([\App\Http\Controllers\LadderController::class, 'getLadderGame'], ['date' => $date, 'game' => $cncnetGame, 'gameId' => $game->id, 'reportId' => $thisGameReport->id]) }}">View</a>
73+
href="{{ route('ladder.game.report', ['date' => $date, 'game' => $cncnetGame, 'gameId' => $game->id, 'reportId' => $thisGameReport->id]) }}">View</a>
7474
@elseif ($userIsMod && $thisGameReport->id == $gameReport->id && !$thisGameReport->best_report)
7575
<form action="/admin/moderate/{{ $history->ladder->id }}/games/switch" class="text-center" method="POST">
7676
<input type="hidden" name="_token" value="{{ csrf_token() }}">

cncnet-api/routes/web.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@
3333
Route::get('{date}/{game}/clan/{clan}', [\App\Http\Controllers\LadderController::class, 'getLadderClan']);
3434
Route::get('{date}/{game}/clan/{clan}/achievements', [\App\Http\Controllers\LadderController::class, 'getPlayerAchievementsPage']);
3535

36-
Route::get('{date}/{game}/games/{gameId}', [\App\Http\Controllers\LadderController::class, 'getLadderGame']);
37-
Route::get('{date}/{game}/games/{gameId}/{reportId}', [\App\Http\Controllers\LadderController::class, 'getLadderGame']);
36+
Route::get('{date}/{game}/games/{gameId}', [\App\Http\Controllers\LadderController::class, 'getLadderGame'])->name('ladder.game');
37+
Route::get('{date}/{game}/games/{gameId}/{reportId}', [\App\Http\Controllers\LadderController::class, 'getLadderGame'])->name('ladder.game.report');
3838
});
3939

4040
# Clan Ladders

0 commit comments

Comments
 (0)