viewlet customization
Stefan Bund [Fri, 23 Oct 2009 10:07:30 +0000 (12:07 +0200)]
src/koehsel.theme/koehsel/theme/configure.zcml
src/koehsel.theme/koehsel/theme/profiles/default/viewlets.xml
src/koehsel.theme/koehsel/theme/skins/koehsel_theme_custom_images/logo.jpg
src/koehsel.theme/koehsel/theme/viewlets/__init__.py [new file with mode: 0644]
src/koehsel.theme/koehsel/theme/viewlets/common.py [new file with mode: 0644]
src/koehsel.theme/koehsel/theme/viewlets/configure.zcml [new file with mode: 0644]
src/koehsel.theme/koehsel/theme/viewlets/personal_bar.pt [new file with mode: 0644]

index 6ce72ed..9b98b1e 100644 (file)
@@ -6,6 +6,7 @@
 
   <five:registerPackage package="." initialize=".initialize" />
   <include package=".browser" />
+  <include package=".viewlets" />
   <include file="skins.zcml" />
   <include file="profiles.zcml" />
 
index 96bc25d..6fe1f96 100644 (file)
@@ -1,10 +1,13 @@
 <?xml version="1.0"?>
 <object>
+  <hidden manager="plone.portaltop" skinname="Plone Default">
+    <viewlet name="plone.path_bar"/>
+  </hidden>
   <hidden manager="plone.portalheader" skinname="Plone Default">
-    <viewlet name="plone.site_actions"/>
     <viewlet name="plone.searchbox"/>
   </hidden>
   <hidden manager="plone.portalfooter" skinname="Plone Default">
     <viewlet name="plone.footer"/>
+    <viewlet name="plone.colophon"/>
   </hidden>
 </object>
index 6109f9b..fae12c7 100644 (file)
Binary files a/src/koehsel.theme/koehsel/theme/skins/koehsel_theme_custom_images/logo.jpg and b/src/koehsel.theme/koehsel/theme/skins/koehsel_theme_custom_images/logo.jpg differ
diff --git a/src/koehsel.theme/koehsel/theme/viewlets/__init__.py b/src/koehsel.theme/koehsel/theme/viewlets/__init__.py
new file mode 100644 (file)
index 0000000..8b13789
--- /dev/null
@@ -0,0 +1 @@
+
diff --git a/src/koehsel.theme/koehsel/theme/viewlets/common.py b/src/koehsel.theme/koehsel/theme/viewlets/common.py
new file mode 100644 (file)
index 0000000..6410eb3
--- /dev/null
@@ -0,0 +1,5 @@
+from plone.app.layout.viewlets import common as base
+from Products.Five.browser.pagetemplatefile import ViewPageTemplateFile
+
+class PersonalBarViewlet(base.PersonalBarViewlet):
+    index = ViewPageTemplateFile('personal_bar.pt')
diff --git a/src/koehsel.theme/koehsel/theme/viewlets/configure.zcml b/src/koehsel.theme/koehsel/theme/viewlets/configure.zcml
new file mode 100644 (file)
index 0000000..de2c58f
--- /dev/null
@@ -0,0 +1,33 @@
+<configure
+    xmlns="http://namespaces.zope.org/zope"
+    xmlns:browser="http://namespaces.zope.org/browser">
+
+  <browser:viewlet
+      name="plone.personal_bar"
+      manager="plone.app.layout.viewlets.interfaces.IPortalTop"
+      class=".common.PersonalBarViewlet"
+      layer="..browser.interfaces.IThemeSpecific"
+      permission="zope2.View" />
+
+  <browser:viewlet
+      name="plone.site_actions"
+      manager="plone.app.layout.viewlets.interfaces.IPortalHeader"
+      class="plone.app.layout.viewlets.common.SiteActionsViewlet"
+      layer="..browser.interfaces.IThemeSpecific"
+      permission="zope2.ViewManagementScreens" />
+
+  <browser:viewlet
+      name="plone.belowcontenttitle.documentbyline"
+      manager="plone.app.layout.viewlets.interfaces.IBelowContentTitle"
+      class="plone.app.layout.viewlets.content.DocumentBylineViewlet"
+      layer="..browser.interfaces.IThemeSpecific"
+      permission="zope2.ViewManagementScreens" />
+
+  <browser:viewlet
+      name="plone.abovecontenttitle.documentactions"
+      manager="plone.app.layout.viewlets.interfaces.IBelowContentBody"
+      class="plone.app.layout.viewlets.content.DocumentActionsViewlet"
+      layer="..browser.interfaces.IThemeSpecific"
+      permission="zope2.ViewManagementScreens" />
+    
+</configure>
diff --git a/src/koehsel.theme/koehsel/theme/viewlets/personal_bar.pt b/src/koehsel.theme/koehsel/theme/viewlets/personal_bar.pt
new file mode 100644 (file)
index 0000000..7858aef
--- /dev/null
@@ -0,0 +1,37 @@
+<div id="portal-personaltools-wrapper"
+     i18n:domain="plone">
+
+<h5 class="hiddenStructure" i18n:translate="heading_personal_tools">Personal tools</h5>
+
+<ul id="portal-personaltools"
+    class="visualInline">
+  <li>&nbsp;</li>
+   <tal:block condition="not: view/anonymous">
+       <li><a 
+           id="user-name"
+           tal:attributes="href view/homelink_url"
+          ><img src="" tal:replace="structure here/user.gif" />
+            <span class="visualCaseSensitive"
+                 tal:content="view/user_name">
+                John
+           </span
+       ></a></li>
+   </tal:block>
+
+    <tal:actions tal:repeat="action view/user_actions">
+        <li tal:define="icon action/icon | nothing;
+                        icon python:icon is not None and icon or view.getIconFor(action['category'], action['id'], None);
+                        class_name string:visualIcon actionicon-${action/category}-${action/id};
+                        class_name python:icon is not None and class_name or nothing;"
+            tal:attributes="class class_name">
+            <a href=""
+               tal:attributes="href action/url;
+                               class python:icon is not None and 'visualIconPadding' or nothing;"
+            ><tal:actionname i18n:translate="" 
+                             tal:content="action/title">dummy</tal:actionname
+            ></a>
+        </li>
+    </tal:actions>
+
+</ul>
+</div>