pour prod
This commit is contained in:
36
app/Views/layouts/footer.php
Normal file
36
app/Views/layouts/footer.php
Normal file
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
/** @var string $csrfToken */
|
||||
/** @var array $motifs */
|
||||
/** @var array $scripts */
|
||||
/** @var array $modules */
|
||||
/** @var array $pageConfig */
|
||||
/** @var array $accessProfile */
|
||||
/** @var array $permissions */
|
||||
?>
|
||||
</main>
|
||||
<script>
|
||||
window.PTA_CONFIG = {
|
||||
csrfToken: <?= json_encode($csrfToken, JSON_THROW_ON_ERROR) ?>,
|
||||
access: <?= json_encode($accessProfile, JSON_THROW_ON_ERROR | JSON_UNESCAPED_UNICODE) ?>,
|
||||
permissions: <?= json_encode($permissions, JSON_THROW_ON_ERROR | JSON_UNESCAPED_UNICODE) ?>,
|
||||
motifs: <?= json_encode(array_map(static function (array $motif): array {
|
||||
return [
|
||||
'id' => (int) $motif['id_motif'],
|
||||
'code' => (string) $motif['code'],
|
||||
'label' => (string) $motif['libelle'],
|
||||
'quota' => (int) $motif['compte_dans_quota'] === 1,
|
||||
];
|
||||
}, $motifs), JSON_THROW_ON_ERROR | JSON_UNESCAPED_UNICODE) ?>
|
||||
};
|
||||
window.PTA_PAGE_CONFIG = <?= json_encode([
|
||||
'modules' => $modules,
|
||||
'params' => $pageConfig,
|
||||
], JSON_THROW_ON_ERROR | JSON_UNESCAPED_UNICODE) ?>;
|
||||
</script>
|
||||
<script src="assets/js/core.js?v=7.7"></script>
|
||||
<?php foreach ($scripts as $script): ?>
|
||||
<script src="assets/js/<?= htmlspecialchars($script) ?>?v=7.7"></script>
|
||||
<?php endforeach; ?>
|
||||
<script src="assets/js/page-bootstrap.js?v=7.7"></script>
|
||||
</body>
|
||||
</html>
|
||||
63
app/Views/layouts/header.php
Normal file
63
app/Views/layouts/header.php
Normal file
@@ -0,0 +1,63 @@
|
||||
<?php
|
||||
/** @var string $pageTitle */
|
||||
/** @var string $activePage */
|
||||
/** @var array $allowedPages */
|
||||
/** @var array $accessProfile */
|
||||
|
||||
$navigation = [
|
||||
'planning' => ['planning.php', 'Saisie'],
|
||||
'pending' => ['pending.php', 'À valider'],
|
||||
'coverage' => ['coverage.php', 'Couverture'],
|
||||
'structures' => ['structures.php', 'Par lieu'],
|
||||
'agents' => ['agents.php', ($accessProfile['role'] ?? '') === 'AGENT' ? 'Mon planning' : 'Par agent'],
|
||||
'annual' => ['annual.php', 'Vue annuelle'],
|
||||
'pta' => ['pta.php', 'PTA détaillé'],
|
||||
'teams' => ['teams.php', 'Équipes'],
|
||||
'vacations' => ['vacations.php', 'Vacances'],
|
||||
'administration' => ['administration.php', 'Administration'],
|
||||
];
|
||||
?>
|
||||
<!doctype html>
|
||||
<html lang="fr">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<title><?= htmlspecialchars($pageTitle) ?> — PTA</title>
|
||||
<link rel="stylesheet" href="assets/style.css?v=7.7">
|
||||
</head>
|
||||
<body>
|
||||
<main class="app-shell">
|
||||
<header class="page-header">
|
||||
<div>
|
||||
<p class="eyebrow">PTA</p>
|
||||
<h1><?= htmlspecialchars($pageTitle) ?></h1>
|
||||
<p class="subtitle">Planification annuelle, équipes, quotas et contrôles métier des accueils de loisirs.</p>
|
||||
</div>
|
||||
<div class="header-actions">
|
||||
<?php if ($activePage === 'planning'): ?>
|
||||
<div id="planning-status" class="status-badge status-neutral">Nouveau planning</div>
|
||||
<?php endif; ?>
|
||||
<div class="access-profile-badge">
|
||||
<span><?= htmlspecialchars((string) ($accessProfile['role_label'] ?? '')) ?></span>
|
||||
<strong><?= htmlspecialchars((string) ($accessProfile['label'] ?? '')) ?></strong>
|
||||
<?php if (!empty($accessProfile['structure_name']) && ($accessProfile['role'] ?? '') === 'AGENT'): ?>
|
||||
<small><?= htmlspecialchars((string) $accessProfile['structure_name']) ?></small>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
<a class="button button-ghost switch-role-link" href="role.php?action=reset">Changer de rôle</a>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
<?php if (!empty($_GET['access_denied'])): ?>
|
||||
<div class="message message-warning role-access-warning">Cette page n’est pas disponible avec votre rôle actuel.</div>
|
||||
<?php endif; ?>
|
||||
|
||||
<nav class="view-tabs" aria-label="Navigation principale">
|
||||
<?php foreach ($navigation as $key => [$href, $label]): ?>
|
||||
<?php if (!in_array($key, $allowedPages, true)) continue; ?>
|
||||
<a class="view-tab<?= $activePage === $key ? ' is-active' : '' ?>" href="<?= htmlspecialchars($href) ?>"<?= $activePage === $key ? ' aria-current="page"' : '' ?>>
|
||||
<?= htmlspecialchars($label) ?>
|
||||
<?php if ($key === 'pending'): ?><span id="pending-validation-tab-badge" class="nav-count-badge" hidden>0</span><?php endif; ?>
|
||||
</a>
|
||||
<?php endforeach; ?>
|
||||
</nav>
|
||||
Reference in New Issue
Block a user