forked from FWS/FWS-TEMPLATE-Website-OnePage
Feat(site): rendu serveur PHP — paquets en SQLite, releases Gitea, build ISO
- Front controller page.php + inc/site.php : coquille et pages rendues
en PHP (accueil, dl, paquets, paquets/N, equipe, contact, 404) ; les
URLs ne changent pas et l'apparence est conservée.
- Paquets stockés dans la base SQLite partagée (table packages),
éditables depuis l'onglet 📦 Paquets de /admin/bugs, avec bouton de
synchronisation des releases depuis l'API Gitea du dépôt lié.
Repli automatique sur packages.json si la base est vide.
- Releases ISO de la page Téléchargements récupérées côté serveur
(Gitea FWS/ISO sinon GitHub) avec cache fichier 10 min ; note de
release rendue en Markdown serveur (Voir plus / Voir moins).
- Suppression du routeur SPA et des chargeurs JS devenus inutiles
(app.js, packages.js, downloads.js, creators-loader.js, index.html) ;
restent nav.js, note-toggle.js et hero-carousel.js.
- Panneau admin : onglet Build ISO (git pull sur main, build.sh avec
repli setup-aur.sh, terminal des logs en direct), durcissement UTF-8
à l'écriture des paquets (json_encode ne casse plus sur des accents
mal encodés), 404 réels et gardes d'accès direct sur les corps PHP.
This commit is contained in:
1 parent
34b3f1cf3c
commit
1775adceaa
34 files changed
+2799
-1862
No files matched your search
@@ -1,18 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="fr">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Paquet | FWS Linux</title>
|
||||
<link rel="stylesheet" href="../../assets/styles/styles.css">
|
||||
<link rel="stylesheet" href="../../assets/styles/paquets.css">
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<main data-page-content>
|
||||
<section class="paquet-detail-page" data-package-detail></section>
|
||||
</main>
|
||||
|
||||
<script src="../../assets/js/packages.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,108 @@
|
||||
<?php
|
||||
/**
|
||||
* FWS Linux — page détail « /?p/paquets/N/ » (rendu serveur).
|
||||
* Le paquet N en grand : badge, tagline, description, dernière release,
|
||||
* historique, captures, liens. Pas de navigation précédent/suivant.
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
if (!defined('FWS_PAGE_SHELL')) {
|
||||
/* Accès direct : /p/paquets/detail.php n'est pas une URL publique. */
|
||||
http_response_code(404);
|
||||
exit('Page introuvable.');
|
||||
}
|
||||
|
||||
/* Le paquet N est identifié par son id en base ; repli sur la position. */
|
||||
$pkg = null;
|
||||
foreach ($packages as $i => $p) {
|
||||
if ((int) ($p['dbId'] ?? 0) === $detailId || ($p['dbId'] ?? 0) === 0 && ($i + 1) === $detailId) {
|
||||
$pkg = $p;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if ($pkg === null) {
|
||||
http_response_code(404);
|
||||
$title = 'Paquet introuvable | FWS Linux';
|
||||
echo '<section class="paquet-detail-page">'
|
||||
. '<p class="paquet-empty">Ce paquet n\'existe pas (il y en a ' . count($packages) . ').</p>'
|
||||
. '<a class="paquet-detail-back" href="/?p/paquets/">← Tous les paquets</a>'
|
||||
. '</section>';
|
||||
return;
|
||||
}
|
||||
|
||||
$title = $pkg['name'] . ' | FWS Linux';
|
||||
$description = (string) ($pkg['tagline'] ?? '') !== '' ? (string) $pkg['tagline'] : (string) ($pkg['description'] ?? '');
|
||||
|
||||
$latest = $pkg['latest'] ?? null;
|
||||
?>
|
||||
<section class="paquet-detail-page">
|
||||
<a class="paquet-detail-back" href="/?p/paquets/">← Tous les paquets</a>
|
||||
|
||||
<div class="paquet-detail-hero">
|
||||
<span class="paquet-since" title="<?= !empty($pkg['since']) ? e('Depuis le ' . fws_format_date((string) $pkg['since'])) : '' ?>"><?= e($pkg['sinceLabel'] !== '' ? $pkg['sinceLabel'] : 'FWS') ?></span>
|
||||
<h1><?= e($pkg['name']) ?></h1>
|
||||
<?php if (!empty($pkg['tagline'])): ?><p class="paquet-tagline"><?= e($pkg['tagline']) ?></p><?php endif; ?>
|
||||
<?php if (!empty($pkg['description'])): ?><p class="paquet-description"><?= e($pkg['description']) ?></p><?php endif; ?>
|
||||
<div class="paquet-detail-latest<?php if ($latest === null || ($latest['name'] ?? '') === ''): ?> paquet-detail-latest-empty<?php endif; ?>">
|
||||
<?php if ($latest !== null && ($latest['name'] ?? '') !== ''): ?>
|
||||
<span class="paquet-detail-version"><?= e((string) $latest['name']) ?></span>
|
||||
<?php if (!empty($latest['date'])): ?>
|
||||
<span class="paquet-detail-date">Publiée le <?= e(fws_format_date((string) $latest['date'])) ?></span>
|
||||
<?php endif; ?>
|
||||
<?php else: ?>
|
||||
Aucune release publiée pour le moment.
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="paquet-detail-body">
|
||||
<?php if (empty($pkg['changelog'])): ?>
|
||||
<div class="paquet-changelog"><h3>Historique</h3><p class="paquet-empty">Historique en cours de rédaction.</p></div>
|
||||
<?php else: ?>
|
||||
<div class="paquet-changelog"><h3>Historique</h3>
|
||||
<ol class="paquet-timeline">
|
||||
<?php foreach ($pkg['changelog'] as $entry): ?>
|
||||
<li class="paquet-timeline-item">
|
||||
<strong class="paquet-timeline-version"><?= e((string) ($entry['version'] ?? '—')) ?></strong>
|
||||
<time class="paquet-timeline-date"<?= !empty($entry['date']) ? ' datetime="' . e((string) $entry['date']) . '"' : '' ?>><?= e(fws_format_date(isset($entry['date']) ? (string) $entry['date'] : null)) ?></time>
|
||||
<?php if (!empty($entry['notes'])): ?>
|
||||
<span class="paquet-timeline-notes"><?= e((string) $entry['notes']) ?></span>
|
||||
<?php endif; ?>
|
||||
</li>
|
||||
<?php endforeach; ?>
|
||||
</ol>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if (empty($pkg['screens'])): ?>
|
||||
<div class="paquet-screens"><h3>Captures d'écran</h3><p class="paquet-empty">Captures d'écran à venir.</p></div>
|
||||
<?php else: ?>
|
||||
<div class="paquet-screens"><h3>Captures d'écran</h3>
|
||||
<div class="paquet-screens-grid">
|
||||
<?php foreach ($pkg['screens'] as $screen): ?>
|
||||
<figure>
|
||||
<img src="<?= e((string) ($screen['src'] ?? '')) ?>" alt="<?= e((string) ($screen['alt'] ?? $pkg['name'])) ?>" loading="lazy">
|
||||
<?php if (!empty($screen['caption'])): ?>
|
||||
<figcaption><?= e((string) $screen['caption']) ?></figcaption>
|
||||
<?php endif; ?>
|
||||
</figure>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
|
||||
<div class="paquet-links">
|
||||
<h3>Liens utiles</h3>
|
||||
<?php if (empty($pkg['links'])): ?>
|
||||
<p class="paquet-empty">Aucun lien pour le moment.</p>
|
||||
<?php else: ?>
|
||||
<?php foreach ($pkg['links'] as $link): ?>
|
||||
<?php $url = (string) ($link['url'] ?? ''); $external = (bool) preg_match('/^https?:\/\//i', $url); ?>
|
||||
<a class="button button-secondary" href="<?= e($url) ?>"<?= $external ? ' target="_blank" rel="noopener noreferrer"' : '' ?>><?= e((string) ($link['label'] ?? '') !== '' ? (string) $link['label'] : $url) ?></a>
|
||||
<?php endforeach; ?>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</section>
|
||||
@@ -1,24 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="fr">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Paquets | FWS Linux</title>
|
||||
<meta name="description" content="Les outils développés pour FWS Linux — historique de chaque paquet, captures d'écran et liens utiles." />
|
||||
<link rel="stylesheet" href="../assets/styles/styles.css">
|
||||
<link rel="stylesheet" href="../assets/styles/paquets.css">
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<main data-page-content>
|
||||
<section class="paquets-hero">
|
||||
<h1>Paquets</h1>
|
||||
<p>Tous les outils développés pour FWS Linux, leur historique, leurs captures d'écran et les liens utiles.</p>
|
||||
</section>
|
||||
|
||||
<section class="paquets-list" data-packages-page aria-label="Liste des paquets FWS"></section>
|
||||
</main>
|
||||
|
||||
<script src="../assets/js/packages.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,117 @@
|
||||
<?php
|
||||
/**
|
||||
* FWS Linux — page Paquets (liste) : rendu serveur depuis la base SQLite
|
||||
* (avec releases Gitea fusionnées). Remplace packages.js.
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
if (!defined('FWS_PAGE_SHELL')) {
|
||||
/* Accès direct (/p/paquets/…) : on délègue au front controller. */
|
||||
require __DIR__ . '/../../page.php';
|
||||
exit;
|
||||
}
|
||||
|
||||
$title = 'Paquets | FWS Linux';
|
||||
$description = 'Les outils développés pour FWS Linux — historique de chaque paquet, captures d\'écran et liens utiles.';
|
||||
|
||||
function fws_packages_empty(string $message): string
|
||||
{
|
||||
return '<p class="paquet-empty">' . e($message) . '</p>';
|
||||
}
|
||||
|
||||
function fws_packages_changelog(array $pkg): string
|
||||
{
|
||||
$html = '<div class="paquet-changelog"><h3>Historique</h3>';
|
||||
if (empty($pkg['changelog'])) {
|
||||
$html .= fws_packages_empty('Historique en cours de rédaction.') . '</div>';
|
||||
return $html;
|
||||
}
|
||||
$html .= '<ol class="paquet-timeline">';
|
||||
foreach ($pkg['changelog'] as $entry) {
|
||||
$html .= '<li class="paquet-timeline-item">'
|
||||
. '<strong class="paquet-timeline-version">' . e((string) ($entry['version'] ?? '—')) . '</strong>'
|
||||
. '<time class="paquet-timeline-date"' . (empty($entry['date']) ? '' : ' datetime="' . e((string) $entry['date']) . '"') . '>'
|
||||
. e(fws_format_date(isset($entry['date']) ? (string) $entry['date'] : null)) . '</time>'
|
||||
. (!empty($entry['notes']) ? '<span class="paquet-timeline-notes">' . e((string) $entry['notes']) . '</span>' : '')
|
||||
. '</li>';
|
||||
}
|
||||
$html .= '</ol></div>';
|
||||
return $html;
|
||||
}
|
||||
|
||||
function fws_packages_screens(array $pkg): string
|
||||
{
|
||||
$html = '<div class="paquet-screens"><h3>Captures d\'écran</h3>';
|
||||
if (empty($pkg['screens'])) {
|
||||
$html .= fws_packages_empty("Captures d'écran à venir.") . '</div>';
|
||||
return $html;
|
||||
}
|
||||
$html .= '<div class="paquet-screens-grid">';
|
||||
foreach ($pkg['screens'] as $screen) {
|
||||
$html .= '<figure><img src="' . e((string) ($screen['src'] ?? '')) . '" alt="'
|
||||
. e((string) ($screen['alt'] ?? ($pkg['name'] ?? ''))) . '" loading="lazy">';
|
||||
if (!empty($screen['caption'])) {
|
||||
$html .= '<figcaption>' . e((string) $screen['caption']) . '</figcaption>';
|
||||
}
|
||||
$html .= '</figure>';
|
||||
}
|
||||
$html .= '</div></div>';
|
||||
return $html;
|
||||
}
|
||||
|
||||
function fws_packages_links(array $pkg): string
|
||||
{
|
||||
$html = '<div class="paquet-links"><h3>Liens utiles</h3>';
|
||||
if (empty($pkg['links'])) {
|
||||
$html .= fws_packages_empty('Aucun lien pour le moment.') . '</div>';
|
||||
return $html;
|
||||
}
|
||||
foreach ($pkg['links'] as $link) {
|
||||
$url = (string) ($link['url'] ?? '');
|
||||
$external = (bool) preg_match('/^https?:\/\//i', $url);
|
||||
$html .= '<a class="button button-secondary" href="' . e($url) . '"'
|
||||
. ($external ? ' target="_blank" rel="noopener noreferrer"' : '') . '>'
|
||||
. e((string) ($link['label'] ?? '') !== '' ? (string) $link['label'] : $url) . '</a>';
|
||||
}
|
||||
$html .= '</div>';
|
||||
return $html;
|
||||
}
|
||||
|
||||
function fws_packages_card(array $pkg, int $position): string
|
||||
{
|
||||
$latest = $pkg['latest'] ?? null;
|
||||
$latestText = ($latest !== null && ($latest['name'] ?? '') !== '')
|
||||
? 'Dernière release : ' . $latest['name'] . (!empty($latest['date']) ? ' — ' . fws_format_date((string) $latest['date']) : '')
|
||||
: 'Aucune release publiée pour le moment.';
|
||||
|
||||
$html = '<article class="paquet-card" id="paquet-' . e((string) $pkg['id']) . '">'
|
||||
. '<header class="paquet-head"><div class="paquet-title-row">'
|
||||
. '<h2>' . e($pkg['name']) . '</h2>'
|
||||
. '<span class="paquet-since" title="' . (!empty($pkg['since']) ? e('Depuis le ' . fws_format_date((string) $pkg['since'])) : '') . '">'
|
||||
. e($pkg['sinceLabel'] !== '' ? $pkg['sinceLabel'] : 'FWS') . '</span>'
|
||||
. '<a class="paquet-detail-link" href="/?p/paquets/' . $position . '/">Voir en grand</a>'
|
||||
. '</div>'
|
||||
. (!empty($pkg['tagline']) ? '<p class="paquet-tagline">' . e($pkg['tagline']) . '</p>' : '')
|
||||
. '<p class="paquet-latest">' . e($latestText) . '</p>'
|
||||
. (!empty($pkg['description']) ? '<p class="paquet-description">' . e($pkg['description']) . '</p>' : '')
|
||||
. '</header>'
|
||||
. '<div class="paquet-body">' . fws_packages_changelog($pkg) . fws_packages_screens($pkg) . fws_packages_links($pkg) . '</div>'
|
||||
. '</article>';
|
||||
return $html;
|
||||
}
|
||||
?>
|
||||
<section class="paquets-hero">
|
||||
<h1>Paquets</h1>
|
||||
<p>Tous les outils développés pour FWS Linux, leur historique, leurs captures d'écran et les liens utiles.</p>
|
||||
</section>
|
||||
|
||||
<section class="paquets-list" aria-label="Liste des paquets FWS">
|
||||
<?php if ($packages === []): ?>
|
||||
<?= fws_packages_empty('Aucun paquet pour le moment. Revenez bientôt !') ?>
|
||||
<?php else: ?>
|
||||
<?php foreach ($packages as $i => $pkg): ?>
|
||||
<?= fws_packages_card($pkg, max($i + 1, (int) ($pkg['dbId'] ?? 0))) . "\n" ?>
|
||||
<?php endforeach; ?>
|
||||
<?php endif; ?>
|
||||
</section>
|
||||
Reference in new issue
Block a user