diff --git a/news/303.feature b/news/303.feature new file mode 100644 index 00000000..43ab669d --- /dev/null +++ b/news/303.feature @@ -0,0 +1,2 @@ +Reimplement dropout toolbar submenus and collapsed icons +[petschki, agitator] diff --git a/plone/app/layout/viewlets/menu.pt b/plone/app/layout/viewlets/menu.pt index 89a5e887..fb11e06a 100644 --- a/plone/app/layout/viewlets/menu.pt +++ b/plone/app/layout/viewlets/menu.pt @@ -15,16 +15,18 @@ - View name + View name - + ${context/ModificationDate} + diff --git a/plone/app/layout/viewlets/toolbar.pt b/plone/app/layout/viewlets/toolbar.pt index 3dadb022..b167bad1 100644 --- a/plone/app/layout/viewlets/toolbar.pt +++ b/plone/app/layout/viewlets/toolbar.pt @@ -1,30 +1,21 @@ - - - - - - - + class="pat-toolbar" data-bs-scroll="true"> - - - - - + + - - + + @@ -35,31 +26,33 @@ - + + class="nav-link dropdown-toggle" + data-bs-toggle="dropdown" + data-bs-offset="0,0" + aria-expanded="false" + tal:attributes="href personal_bar/homelink_url"> - User + User - - - - - - - action title - - - - - + + + ${personal_bar/user_name} + + + + + + action title + + + + diff --git a/plone/app/layout/viewlets/toolbar.py b/plone/app/layout/viewlets/toolbar.py index 09aaaf65..67ceb14d 100644 --- a/plone/app/layout/viewlets/toolbar.py +++ b/plone/app/layout/viewlets/toolbar.py @@ -11,6 +11,12 @@ class ToolbarViewletManager(OrderedViewletManager): custom_template = ViewPageTemplateFile("toolbar.pt") + @property + @memoize + def _settings(self): + registry = getUtility(IRegistry) + return registry.forInterface(ISiteSchema, prefix="plone", check=False) + def base_render(self): return super().render() @@ -27,17 +33,18 @@ def context_state(self): def portal_state(self): return getMultiAdapter((self.context, self.request), name="plone_portal_state") + def toolbar_position(self): + return self._settings.toolbar_position + def get_personal_bar(self): viewlet = PersonalBarViewlet(self.context, self.request, self.__parent__, self) viewlet.update() return viewlet def get_toolbar_logo(self): - registry = getUtility(IRegistry) - settings = registry.forInterface(ISiteSchema, prefix="plone", check=False) portal_url = self.portal_state.portal_url() try: - logo = settings.toolbar_logo + logo = self._settings.toolbar_logo except AttributeError: logo = "/++plone++static/plone-toolbarlogo.svg" if not logo: