Supprime le double scroll : menu à hauteur du titre, marge Gin retirée
Le menu Grand livre/Dashboard/Par compte passe en position fixe, aligné avec le <h1> de la page plutôt que sur sa propre ligne en dessous -- les deux viennent de régions Drupal différentes (le titre du bloc sticky top-bar de Gin, le menu du contenu de la page) sans conteneur flex/grid commun pour les aligner autrement. Ça ne suffisait pas à éliminer le scroll de page en plus de celui du tableau (max-height: 75vh sur .figli-table-wrap) : Gin applique un margin-bottom: 80px sur <main class="page-content">, pensé pour une page d'admin classique, pas pour ce layout à hauteur de viewport fixe. Neutralisé sur les routes du module (hide_admin_chrome, déjà route- scopé). Au passage, corrige un oubli : figli_compta_ledger.dashboard_compte n'était jamais dans la liste hide_admin_chrome, donc la barre d'admin Gin restait visible sur /dashboard/compte (et donc le titre plus bas que sur les 3 autres pages) -- ajouté. Et sur demande complémentaire en cours de route : le même menu manquait purement et simplement sur /lignes/historique (pas de template Twig propre, juste un tableau brut) -- ajouté en tableau de rendu directement dans HistoryController, mêmes classes CSS que le <nav> des autres pages.
This commit is contained in:
@@ -2,12 +2,28 @@
|
||||
on those two custom routes, but attached here rather than duplicated
|
||||
between home.css and dashboard.css -- and defined with its own explicit
|
||||
colors rather than relying on either page's #figli-*-app-scoped custom
|
||||
properties, since this <nav> sits outside both of those elements. */
|
||||
properties, since this <nav> sits outside both of those elements.
|
||||
|
||||
Fixed rather than in normal flow: this <nav> and the page's <h1>
|
||||
("Grand livre - SAS Figures Libres" etc.) come from two different
|
||||
Drupal block regions (the title from Gin's sticky top-bar header,
|
||||
this nav from the page content below it) with no shared flex/grid
|
||||
container to align them side by side declaratively -- in normal flow
|
||||
it rendered as its own full-width row *under* the title, costing
|
||||
~75px of vertical space the table below could otherwise use before
|
||||
the whole page (not just the table's own internal scroll) needed to
|
||||
scroll too. Pulling it out of flow and pinning it next to the title
|
||||
reclaims that space; top/right below are tuned to that title's actual
|
||||
position, not derived from it, so they'd need revisiting if Gin's
|
||||
header height or padding ever changes. */
|
||||
.figli-page-nav {
|
||||
position: fixed;
|
||||
top: 0.65rem;
|
||||
right: 1rem;
|
||||
z-index: 50;
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
gap: 0.4rem;
|
||||
padding: 0.5rem 0.25rem 0;
|
||||
}
|
||||
.figli-page-nav a {
|
||||
padding: 0.3rem 0.8rem;
|
||||
|
||||
@@ -26,3 +26,14 @@
|
||||
.dialog-off-canvas-main-canvas {
|
||||
margin-inline-start: 0 !important;
|
||||
}
|
||||
|
||||
/* Gin's default 80px margin-bottom on <main>, meant as breathing room
|
||||
below a normal admin content page -- on this app's tight,
|
||||
single-viewport layout (page nav pinned next to the title, table
|
||||
scrolling internally, see .figli-page-nav in admin-chrome.css) it was
|
||||
the last remaining chunk of an *outer* page scroll on top of the
|
||||
table's own, since max-height: 75vh on .figli-table-wrap already
|
||||
accounts for everything else above/below it but not this. */
|
||||
main.page-content {
|
||||
margin-bottom: 0 !important;
|
||||
}
|
||||
|
||||
@@ -422,6 +422,7 @@ function figli_compta_ledger_page_attachments(array &$attachments) {
|
||||
$front_end_routes = [
|
||||
'figli_compta_ledger.home',
|
||||
'figli_compta_ledger.dashboard',
|
||||
'figli_compta_ledger.dashboard_compte',
|
||||
'figli_compta_ledger.history',
|
||||
'figli_compta_ledger.link_entree',
|
||||
];
|
||||
|
||||
@@ -57,6 +57,34 @@ class HistoryController extends ControllerBase {
|
||||
}
|
||||
|
||||
return [
|
||||
// Same markup/classes as the <nav class="figli-page-nav"> block in
|
||||
// figli-compta-home.html.twig et al. (styled in admin-chrome.css,
|
||||
// pinned next to the page title) -- this controller has no twig
|
||||
// template of its own to put a real <nav> in, but the CSS only
|
||||
// ever targets the class, not the tag, so a render-array
|
||||
// 'container' (<div>) here looks identical. None of the three
|
||||
// links is ever "active" here since this history feed isn't one
|
||||
// of them -- same as visiting it from any of the other pages'
|
||||
// nav, which doesn't include a 4th "Historique" entry either.
|
||||
'nav' => [
|
||||
'#type' => 'container',
|
||||
'#attributes' => ['class' => ['figli-page-nav']],
|
||||
'home' => [
|
||||
'#type' => 'link',
|
||||
'#title' => $this->t('Grand livre'),
|
||||
'#url' => Url::fromRoute('figli_compta_ledger.home'),
|
||||
],
|
||||
'dashboard' => [
|
||||
'#type' => 'link',
|
||||
'#title' => $this->t('Dashboard'),
|
||||
'#url' => Url::fromRoute('figli_compta_ledger.dashboard'),
|
||||
],
|
||||
'dashboard_compte' => [
|
||||
'#type' => 'link',
|
||||
'#title' => $this->t('Par compte'),
|
||||
'#url' => Url::fromRoute('figli_compta_ledger.dashboard_compte'),
|
||||
],
|
||||
],
|
||||
'table' => [
|
||||
'#type' => 'table',
|
||||
'#header' => [
|
||||
|
||||
Reference in New Issue
Block a user