chore: remove unused match-stub and upload-result view templates
Neither src/Views/match-stub.php nor src/Views/upload-result.php is
referenced by any handler or route in Plan 3b:
- match-stub is the Plan 4 battle-interface placeholder; Plan 3b does
not register a /match route.
- upload-result is the iframe-style post-upload response; Plan 3b
returns JSON from POST /assets/upload and Plan 3c will wire the
client-side upload form.
Both files were over-eager scaffolding from Task 3 (6a0b147). Drop
them in a follow-up commit rather than amend the shared Task 3 commit.
This commit is contained in:
@@ -1,28 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
declare(strict_types=1);
|
|
||||||
|
|
||||||
use BattleForge\Http\Escape;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @var string $csrf Provided by the front controller.
|
|
||||||
* @var ?string $matchJson The match:current JSON from localStorage, encoded as a string.
|
|
||||||
* Null if no match is in progress.
|
|
||||||
*/
|
|
||||||
$e = static fn (string $v): string => Escape::html($v);
|
|
||||||
$matchInfo = $matchJson !== null ? "Match loaded." : "No match in progress.";
|
|
||||||
?><?php
|
|
||||||
render_layout(static function () use ($e, $matchInfo, $matchJson): void {
|
|
||||||
?>
|
|
||||||
<h1>Match</h1>
|
|
||||||
<p><?= $e($matchInfo) ?></p>
|
|
||||||
<?php if ($matchJson !== null) : ?>
|
|
||||||
<details>
|
|
||||||
<summary>Match state (debug)</summary>
|
|
||||||
<pre><?= $e($matchJson) ?></pre>
|
|
||||||
</details>
|
|
||||||
<?php endif; ?>
|
|
||||||
<p>Battle interface coming in Plan 4.</p>
|
|
||||||
<p><a href="/">Back to home</a></p>
|
|
||||||
<?php
|
|
||||||
}, $csrf, 'Match');
|
|
||||||
@@ -1,26 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
declare(strict_types=1);
|
|
||||||
|
|
||||||
use BattleForge\Http\Escape;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @var string $csrf Provided by the front controller.
|
|
||||||
* @var string $url The uploaded image's URL, written into the parent form's hidden field.
|
|
||||||
*/
|
|
||||||
$e = static fn (string $v): string => Escape::html($v);
|
|
||||||
$json = json_encode(['url' => $url], JSON_THROW_ON_ERROR);
|
|
||||||
?><?php
|
|
||||||
render_layout(static function () use ($e, $url, $json): void {
|
|
||||||
?>
|
|
||||||
<p>Uploaded: <code><?= $e($url) ?></code></p>
|
|
||||||
<script>
|
|
||||||
(function () {
|
|
||||||
var data = <?= $json /* trusted raw JSON; $url was validated server-side */ ?>;
|
|
||||||
if (window.parent && window.parent !== window) {
|
|
||||||
window.parent.postMessage(Object.assign({type: 'bf-upload'}, data), '*');
|
|
||||||
}
|
|
||||||
})();
|
|
||||||
</script>
|
|
||||||
<?php
|
|
||||||
}, $csrf, 'Upload complete');
|
|
||||||
Reference in New Issue
Block a user