From: Guillaume AGNIERAY Date: Tue, 3 Oct 2023 08:31:27 +0000 (+0200) Subject: New toggable compact rendering on navigation aside X-Git-Tag: 1.0.0rc2~70 X-Git-Url: https://git.agnieray.net/?a=commitdiff_plain;h=932d0dd4ba841915abc10e1bcef1195b1fd057fa;p=galette.git New toggable compact rendering on navigation aside --- diff --git a/galette/lib/Galette/Core/Authentication.php b/galette/lib/Galette/Core/Authentication.php index 206c7e30e..da32eb55c 100644 --- a/galette/lib/Galette/Core/Authentication.php +++ b/galette/lib/Galette/Core/Authentication.php @@ -77,6 +77,7 @@ abstract class Authentication protected $uptodate = false; protected $managed_groups = []; protected $cron = false; + protected $compact_menu = false; /** * Logs in user. @@ -261,6 +262,16 @@ abstract class Authentication return $this->managed_groups; } + /** + * Get compact menu mode + * + * @return bool + */ + public function getCompactMenu(): bool + { + return ($this->logged && isset($_COOKIE['galette_compact_menu']) && $_COOKIE['galette_compact_menu']) ? true : false; + } + /** * Is user currently up to date? * An up to date member is active and either due free, or with up to date diff --git a/galette/templates/default/elements/logout.html.twig b/galette/templates/default/elements/logout.html.twig index f9b4ffbb3..16f9afd68 100644 --- a/galette/templates/default/elements/logout.html.twig +++ b/galette/templates/default/elements/logout.html.twig @@ -5,38 +5,72 @@ {% set component_classes = "ui text compact small fluid menu" %} {% endif %} {% endif %} - -{% if ui == 'item' %} -
-
- {{ login.loggedInAs()|raw }} -
- - - {% if login.isImpersonated() %}{{ _T("Unimpersonate") }}{% else %}{{ _T("Log off") }}{% endif %} - -
-{% else %} -
-
- - {{ login.loggedInAs()|raw }} -
-