[CMF-checkins] CVS: Products/CMFDefault/skins/zpt_generic - main_template.pt:1.16 permalink.py:1.3 zpt_stylesheet.css:1.12

Yvo Schubbe y.2005- at wcm-solutions.de
Sun Mar 13 14:06:30 EST 2005


Update of /cvs-repository/Products/CMFDefault/skins/zpt_generic
In directory cvs.zope.org:/tmp/cvs-serv29991/CMFDefault/skins/zpt_generic

Modified Files:
	main_template.pt permalink.py zpt_stylesheet.css 
Log Message:
forward-porting CMFUid related changes from CMF-1_5-branch


=== Products/CMFDefault/skins/zpt_generic/main_template.pt 1.15 => 1.16 ===
--- Products/CMFDefault/skins/zpt_generic/main_template.pt:1.15	Sun Aug  8 20:24:48 2004
+++ Products/CMFDefault/skins/zpt_generic/main_template.pt	Sun Mar 13 14:06:29 2005
@@ -4,7 +4,6 @@
                   mtool here/portal_membership;
                   atool here/portal_actions;
                   wtool here/portal_workflow;
-                  uidtool here/portal_uidhandler | nothing;
                   portal_object utool/getPortalObject;
                   portal_title portal_object/Title;
                   object_title here/Title;
@@ -300,16 +299,15 @@
 
  <!-- end main slot -->
  </div>
-
- <div tal:condition="not:here/isPrincipiaFolderish | nothing">
- <p tal:define="uid python:uidtool.register(here);"
-    tal:on-error="nothing">Permalink: 
-  <a href=""
-     tal:define="url string:${portal_url}/permalink/${uid};"
-     tal:content="url"
-     tal:attributes="href url">
-  the unique id</a>
- </p>
+ 
+ <div id="Permalink"
+      tal:define="url here/get_permalink | nothing"
+      tal:condition="url">
+  <span i18n:translate="" tal:omit-tag="">Permanent Link:</span>
+  <a href="" tal:content="url" tal:attributes="href url">
+    the permanent link if enabled
+  </a>
+ </div>
 
  <!-- end Desktop -->
  </div>


=== Products/CMFDefault/skins/zpt_generic/permalink.py 1.2 => 1.3 ===
--- Products/CMFDefault/skins/zpt_generic/permalink.py:1.2	Wed Sep  8 03:42:14 2004
+++ Products/CMFDefault/skins/zpt_generic/permalink.py	Sun Mar 13 14:06:29 2005
@@ -9,8 +9,20 @@
 ##
 from Products.CMFCore.utils import getToolByName
 
-uid_handler = getToolByName(context, 'portal_uidhandler')
-obj = uid_handler.getObject(traverse_subpath[0])
+subpath = traverse_subpath[0]
+uid_handler = getToolByName(context, 'portal_uidhandler', None)
+
+# appending 'isAvailable' instead of a unique id returns if
+# the site permalink feature is available.
+if str(subpath).strip() == 'isAvailable':
+    # no permalink feature without an uid handler tool being installed
+    if uid_handler is None:
+        return '0'
+    proptool = getToolByName(context, 'portal_properties', None)
+    isAvailable = getattr(proptool, 'enable_permalink', 0)
+    return str(int(isAvailable))
+
+obj = uid_handler.getObject(subpath)
 
 ti = obj.getTypeInfo()
 method_id = ti and ti.queryMethodID('view')


=== Products/CMFDefault/skins/zpt_generic/zpt_stylesheet.css 1.11 => 1.12 ===
--- Products/CMFDefault/skins/zpt_generic/zpt_stylesheet.css:1.11	Fri Jun  4 06:10:41 2004
+++ Products/CMFDefault/skins/zpt_generic/zpt_stylesheet.css	Sun Mar 13 14:06:29 2005
@@ -207,7 +207,12 @@
     margin-right: 2pt;
 }
 
+#Permalink {
+    font-size: 80%;
+}
+
 #ContentByline {
+    margin-top: 8pt;
     font-size: 90%;
     font-style: italic;
 }



More information about the CMF-checkins mailing list