mirror of
https://codeberg.org/PostERG/xamxam.git
synced 2026-05-06 11:09:18 +02:00
SQLite performance (Database::__construct): - PRAGMA journal_mode = WAL: eliminates full-DB read locks on write, safe for concurrent PHP-FPM workers - PRAGMA synchronous = NORMAL: durable on commit without full fsync per write - PRAGMA cache_size = -8000: ~8 MB page cache per connection Accessibility foundation (WCAG 2.1 AA): - common.css: add .sr-only utility, .skip-link (hidden until focused), global :focus-visible (2px purple outline, 2px offset), prefers-reduced-motion guard; remove bare outline:none from .site-search__input - admin.css: same :focus-visible, skip-link, and motion guard scoped to admin purple; remove outline:none from .admin-input/.admin-select/ .admin-textarea and .admin-filters select (both had :focus border rules already, so focus is still visually communicated) - search.css: remove outline:none from .search-filter-select (already has :focus border-color rule) - All 5 public pages (index, search, tfe, apropos, licence): add <a href="#main-content" class="skip-link"> as first child of <body>; add id="main-content" to <main> - templates/admin/head.php: same skip link; aria-label="Navigation admin" on <nav>; id="main-content" on all 10 admin <main> elements All 4 test suites pass (unit, integration, security, rate-limit).
66 lines
2.1 KiB
PHP
66 lines
2.1 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">
|
||
<a href="#main-content" class="skip-link">Aller au contenu principal</a>
|
||
|
||
<?php include APP_ROOT . '/templates/nav.php'; ?>
|
||
<?php include APP_ROOT . '/templates/search-bar.php'; ?>
|
||
|
||
<main class="apropos-main" id="main-content">
|
||
<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>
|