129 lines
5.7 KiB
PHP
129 lines
5.7 KiB
PHP
<section class="detail-hero">
|
|
<div class="detail-cover">
|
|
<img
|
|
src="<?php print Helpers::echapper(Helpers::urlJaquette($jeu["jaquette"] ?? null)); ?>"
|
|
alt="Jaquette de <?php print Helpers::echapper($jeu["titre"]); ?>"
|
|
>
|
|
</div>
|
|
<div class="detail-info">
|
|
<p class="eyebrow"><?php print Helpers::echapper($console["nom"] ?? "Console"); ?></p>
|
|
<h1 class="page-title"><?php print Helpers::echapper($jeu["titre"]); ?></h1>
|
|
<div class="detail-meta">
|
|
<span class="badge-etat etat-<?php print Helpers::echapper($jeu["etat"]); ?>">
|
|
<?php print Helpers::echapper(Helpers::libelleEtat($jeu["etat"])); ?>
|
|
</span>
|
|
<?php foreach (Helpers::normaliserFormats($jeu["formats"] ?? []) as $format): ?>
|
|
<span class="badge-format format-<?php print Helpers::echapper($format); ?>">
|
|
<?php print Helpers::echapper(Helpers::libelleFormat($format)); ?>
|
|
</span>
|
|
<?php endforeach; ?>
|
|
<?php if (!empty($jeu["dateSortie"])): ?>
|
|
<span><i class="mdi mdi-calendar"></i> <?php print Helpers::echapper($jeu["dateSortie"]); ?></span>
|
|
<?php endif; ?>
|
|
<?php if (!empty($jeu["sourceEnrichissement"])): ?>
|
|
<span><i class="mdi mdi-database-outline"></i> <?php print Helpers::echapper($jeu["sourceEnrichissement"]); ?></span>
|
|
<?php endif; ?>
|
|
</div>
|
|
<div class="page-actions mt-3">
|
|
<a href="/jeux/<?php print Helpers::echapper($jeu["id"]); ?>/modifier" class="btn btn-neon">
|
|
<i class="mdi mdi-pencil"></i> Modifier
|
|
</a>
|
|
<?php if (!empty($jaquetteAbsente) && !empty($apiDisponible)): ?>
|
|
<form method="post" action="/jeux/<?php print Helpers::echapper($jeu["id"]); ?>/jaquette">
|
|
<?php print Csrf::champCache(); ?>
|
|
<button type="submit" class="btn btn-outline-neon">
|
|
<i class="mdi mdi-image-search-outline"></i> Récupérer la jaquette
|
|
</button>
|
|
</form>
|
|
<?php endif; ?>
|
|
<form method="post" action="/jeux/<?php print Helpers::echapper($jeu["id"]); ?>/supprimer" onsubmit="return confirm('Supprimer ce jeu ?');">
|
|
<?php print Csrf::champCache(); ?>
|
|
<button type="submit" class="btn btn-outline-danger">
|
|
<i class="mdi mdi-delete-outline"></i> Supprimer
|
|
</button>
|
|
</form>
|
|
</div>
|
|
|
|
<form
|
|
method="post"
|
|
action="/jeux/<?php print Helpers::echapper($jeu["id"]); ?>/jaquette/upload"
|
|
enctype="multipart/form-data"
|
|
class="photo-upload-bar mt-4"
|
|
>
|
|
<?php print Csrf::champCache(); ?>
|
|
<label class="form-label" for="jaquetteFichier">
|
|
<i class="mdi mdi-image-edit-outline"></i>
|
|
<?php print !empty($jaquetteAbsente) ? "Envoyer une jaquette" : "Remplacer la jaquette"; ?>
|
|
</label>
|
|
<div class="photo-upload-row">
|
|
<input
|
|
type="file"
|
|
class="form-control"
|
|
id="jaquetteFichier"
|
|
name="jaquetteFichier"
|
|
accept="image/jpeg,image/png,image/webp,image/gif,image/*"
|
|
required
|
|
>
|
|
<button type="submit" class="btn btn-neon">
|
|
<i class="mdi mdi-upload"></i> Envoyer
|
|
</button>
|
|
</div>
|
|
<div class="form-text">Choisissez une image (JPG, PNG, WebP, GIF — 5 Mo max) pour corriger une jaquette incorrecte.</div>
|
|
</form>
|
|
</div>
|
|
</section>
|
|
|
|
<section class="detail-grid mt-4">
|
|
<article class="form-panel">
|
|
<h2>Description</h2>
|
|
<?php if (!empty($jeu["description"])): ?>
|
|
<p class="detail-text"><?php print nl2br(Helpers::echapper($jeu["description"])); ?></p>
|
|
<?php else: ?>
|
|
<p class="text-muted">Aucune description.</p>
|
|
<?php endif; ?>
|
|
</article>
|
|
|
|
<aside class="form-panel">
|
|
<h2>Informations</h2>
|
|
<dl class="info-list">
|
|
<div>
|
|
<dt>Développeur</dt>
|
|
<dd><?php print Helpers::echapper($jeu["developpeur"] ?: "—"); ?></dd>
|
|
</div>
|
|
<div>
|
|
<dt>Éditeur</dt>
|
|
<dd><?php print Helpers::echapper($jeu["editeur"] ?: "—"); ?></dd>
|
|
</div>
|
|
<div>
|
|
<dt>Genres</dt>
|
|
<dd>
|
|
<?php if (!empty($jeu["genres"])): ?>
|
|
<?php print Helpers::echapper(implode(", ", $jeu["genres"])); ?>
|
|
<?php else: ?>
|
|
—
|
|
<?php endif; ?>
|
|
</dd>
|
|
</div>
|
|
<div>
|
|
<dt>Supports</dt>
|
|
<dd>
|
|
<?php $formats = Helpers::normaliserFormats($jeu["formats"] ?? []); ?>
|
|
<?php if ($formats === []): ?>
|
|
—
|
|
<?php else: ?>
|
|
<?php foreach ($formats as $format): ?>
|
|
<span class="badge-format format-<?php print Helpers::echapper($format); ?>">
|
|
<?php print Helpers::echapper(Helpers::libelleFormat($format)); ?>
|
|
</span>
|
|
<?php endforeach; ?>
|
|
<?php endif; ?>
|
|
</dd>
|
|
</div>
|
|
<div>
|
|
<dt>Notes</dt>
|
|
<dd><?php print nl2br(Helpers::echapper($jeu["notes"] ?: "—")); ?></dd>
|
|
</div>
|
|
</dl>
|
|
</aside>
|
|
</section>
|