mirror of
https://codeberg.org/PostERG/xamxam.git
synced 2026-05-07 11:39:18 +02:00
- Feature 1: public /licence.php fetches 'licenses' page from DB, renders Markdown - Feature 1: nav.php adds 'Licence' link with active state - Feature 2: Database::getPage(), savePage(), getAllPages() methods - Feature 2: bundled src/Parsedown.php (MIT, zero-dependency) - Feature 2: apropos.php now renders 'about' page content from DB via Parsedown - Feature 2: admin/pages.php (list) + admin/pages-edit.php (EasyMDE editor) - Feature 2: admin/actions/page.php (auth+CSRF+validation+save) - Feature 2: admin/head.php adds 'Pages statiques' nav link - Feature 3: storage/schema.sql seeds 8 CC license types - Feature 3: storage/migrations/003_seed_license_types.sql (applied to live DB) - Feature 3: Database::getLicenseTypes() / getAllLicenseTypes() - Feature 3: admin/add.php + formulaire.php: license_id field on add form - Feature 3: admin/edit.php: license_id field on edit form with raw FK lookup - Feature 3: tfe.php: shows 'Licence :' meta row when non-null - Feature 6: main.css: .card__media--gradient styles - Feature 6: index.php: deterministic HSL gradient placeholder cards - Feature 6: Database::getLatestYearTheses() + getLatestPublishedYear() - Feature 6: index.php default home = random latest-year theses with info label
65 lines
2.0 KiB
PHP
65 lines
2.0 KiB
PHP
<?php
|
||
require_once __DIR__ . '/../config/bootstrap.php';
|
||
require_once APP_ROOT . '/src/Database.php';
|
||
require_once APP_ROOT . '/src/Parsedown.php';
|
||
|
||
$currentNav = 'licence';
|
||
|
||
try {
|
||
$db = Database::getInstance();
|
||
$page = $db->getPage('licenses');
|
||
$content = $page ? $page['content'] : '';
|
||
$pageTitle = $page ? $page['title'] : 'Licences';
|
||
} catch (Exception $e) {
|
||
error_log("Error loading licence page: " . $e->getMessage());
|
||
$content = '';
|
||
$pageTitle = 'Licences';
|
||
}
|
||
|
||
$pd = new Parsedown();
|
||
$pd->setSafeMode(true);
|
||
$html = $pd->text($content);
|
||
?>
|
||
<!DOCTYPE html>
|
||
<html lang="fr">
|
||
<head>
|
||
<meta charset="UTF-8">
|
||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||
<title><?= htmlspecialchars($pageTitle) ?> – Posterg</title>
|
||
<link rel="icon" type="image/svg+xml" href="/assets/admin_favicon.svg">
|
||
<link rel="stylesheet" href="assets/modern-normalize.min.css">
|
||
<link rel="stylesheet" href="assets/common.css">
|
||
<link rel="stylesheet" href="assets/apropos.css">
|
||
<?php if (php_sapi_name() === 'cli-server'): ?>
|
||
<script>
|
||
(function poll(){
|
||
fetch('/live-reload.php').then(r=>r.json()).then(d=>{
|
||
if(d.changed) location.reload(); else setTimeout(poll,1000);
|
||
}).catch(()=>setTimeout(poll,2000));
|
||
})();
|
||
</script>
|
||
<?php endif; ?>
|
||
</head>
|
||
<body class="apropos-body">
|
||
|
||
<?php include APP_ROOT . '/templates/nav.php'; ?>
|
||
<?php include APP_ROOT . '/templates/search-bar.php'; ?>
|
||
|
||
<main class="apropos-main">
|
||
<div class="apropos-layout">
|
||
<div class="apropos-left">
|
||
<div class="apropos-description apropos-page-content">
|
||
<?php if (!empty(trim($content))): ?>
|
||
<?= $html ?>
|
||
<?php else: ?>
|
||
<p>Contenu à venir.</p>
|
||
<?php endif; ?>
|
||
</div>
|
||
</div>
|
||
<div class="apropos-right"></div>
|
||
</div>
|
||
</main>
|
||
|
||
</body>
|
||
</html>
|