Skip to content

Commit

Permalink
Position on the body tag
Browse files Browse the repository at this point in the history
  • Loading branch information
bloodbare committed Jul 16, 2015
1 parent 52e78b4 commit 176bdca
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 27 deletions.
21 changes: 6 additions & 15 deletions plone/app/layout/globals/layout.py
Original file line number Diff line number Diff line change
Expand Up @@ -186,23 +186,14 @@ def bodyClass(self, template, view):
for role in user.getRolesInContext(self.context):
body_classes.append('userrole-' + role.lower().replace(' ', '-'))

registry = getUtility(IRegistry)
settings = registry.forInterface(ISiteSchema, prefix='plone')

# toolbar classes
toolbar_state = self.request.cookies.get('plone-toolbar')
if toolbar_state:
if 'plone-toolbar-left' in toolbar_state:
if 'expanded' in toolbar_state:
body_classes.append('plone-toolbar-left-expanded')
else:
body_classes.append('plone-toolbar-left-default')
if 'plone-toolbar-top' in toolbar_state:
if 'expanded' in toolbar_state:
body_classes.append('plone-toolbar-top-expanded')
else:
body_classes.append('plone-toolbar-top-default')
if 'compressed' in toolbar_state:
body_classes.append('plone-toolbar-compressed')
if settings.toolbar_position == 'side':
body_classes.append('plone-toolbar-left')
else:
body_classes.append('plone-toolbar-left-default')
body_classes.append('plone-toolbar-top')

# class for markspeciallinks pattern
properties = getToolByName(context, "portal_properties")
Expand Down
6 changes: 2 additions & 4 deletions plone/app/layout/viewlets/toolbar.pt
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,16 @@
personal_bar python: view.get_personal_bar()"
tal:condition="not: portal_state/anonymous"
i18n:domain="plone">
<div id="edit-zone" role="toolbar" tal:attributes="class toolbar_class">
<div id="edit-zone" role="toolbar" class="pat-toolbar">
<div class="plone-toolbar-container">
<a class="plone-toolbar-logo">
<img alt="Plone Toolbar" tal:attributes="src view/get_toolbar_logo" />
</a>
<a class="plone-toolbar-switcher" tal:condition="view/show_switcher"><span>Left-Top switcher</span></a>
<nav role="navigation">
<ul class="plone-toolbar-main">
<ul>
<div tal:replace="structure view/base_render">
</div>
</ul>
<ul id="personal-bar-container">
<li id="portal-personaltools" class="plone-toolbar-separator"
tal:condition="personal_bar/user_actions">
<a href="#"
Expand Down
8 changes: 0 additions & 8 deletions plone/app/layout/viewlets/toolbar.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,6 @@ def get_toolbar_logo(self):
portal_url = self.portal_state.portal_url()
return portal_url + settings.toolbar_logo

def get_toolbar_position(self):
registry = getUtility(IRegistry)
settings = registry.forInterface(ISiteSchema, prefix='plone')
if settings.toolbar_position == 'side':
return 'plone-toolbar-left pat-toolbar'
else:
return 'portal-toolbar-top pat-toolbar'

def show_switcher(self):
return False

Expand Down

0 comments on commit 176bdca

Please sign in to comment.