Skip to content

Commit

Permalink
Merge pull request #128 from plone/personal-bar
Browse files Browse the repository at this point in the history
Member bar
  • Loading branch information
esteele authored Jul 4, 2017
2 parents 3e25185 + 19fa14c commit 2f7d4cf
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 3 deletions.
3 changes: 2 additions & 1 deletion CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ Breaking changes:

New features:

- *add item here*
- Added membertools viewlet. If user is not anonymous and toolbar is not visible according to ``is_toolbar_visible`` the viewlet will show at the location of anontools.
[agitator]

Bug fixes:

Expand Down
4 changes: 2 additions & 2 deletions plone/app/layout/viewlets/anontools.pt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<div id='portal-anontools'>
<ul tal:condition="python:view.user_actions and view.anonymous">
<div id="portal-anontools" tal:condition="python:view.user_actions and view.anonymous">
<ul>
<li>
<tal:actions repeat="action view/user_actions">
<a href=""
Expand Down
9 changes: 9 additions & 0 deletions plone/app/layout/viewlets/configure.zcml
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,15 @@
template="anontools.pt"
/>

<!-- The member panel (logout, user actions) -->
<browser:viewlet
name="plone.membertools"
manager=".interfaces.IPortalHeader"
class=".common.PersonalBarViewlet"
permission="zope2.View"
template="membertools.pt"
/>

<!-- The logo -->
<browser:viewlet
name="plone.logo"
Expand Down
31 changes: 31 additions & 0 deletions plone/app/layout/viewlets/membertools.pt
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<div id="portal-membertools-wrapper"
i18n:domain="plone"
tal:define="toolbar_visible here/@@plone_context_state/is_toolbar_visible;
isAnon view/anonymous;"
tal:condition="python:not isAnon and not toolbar_visible">

<p class="hiddenStructure" i18n:translate="heading_member_tools">Member tools</p>

<div class="dropdown pull-right" id="portal-membertools"
tal:condition="python:view.user_actions and not view.anonymous">
<a id="user-name"
class="dropdown-toggle" data-toggle="dropdown"
tal:attributes="href view/homelink_url">
<span tal:replace="view/user_name">John</span>
<span class="caret"></span>
</a>
<ul class="dropdown-menu" role="menu" aria-labelledby="dropdownMenu">
<li tal:repeat="action view/user_actions"
tal:attributes="id string:membertools-${action/id}">
<a href=""
tal:attributes="href action/href;
target action/link_target|nothing"
tal:content="action/title"
i18n:translate="">
action title
</a>
</li>
</ul>
</div>

</div>

0 comments on commit 2f7d4cf

Please sign in to comment.