[Checkins] SVN: zopeorg.theme/trunk/zopeorg/theme/browser/ made Feature viewlets to work with real content from the object

Denis Mishunov denis.mishunoff at gmail.com
Sun Feb 3 14:04:29 EST 2008


Log message for revision 83460:
  made Feature viewlets to work with real content from the object

Changed:
  U   zopeorg.theme/trunk/zopeorg/theme/browser/templates/divider.pt
  U   zopeorg.theme/trunk/zopeorg/theme/browser/templates/feature.pt
  U   zopeorg.theme/trunk/zopeorg/theme/browser/viewlets.py

-=-
Modified: zopeorg.theme/trunk/zopeorg/theme/browser/templates/divider.pt
===================================================================
--- zopeorg.theme/trunk/zopeorg/theme/browser/templates/divider.pt	2008-02-03 18:44:46 UTC (rev 83459)
+++ zopeorg.theme/trunk/zopeorg/theme/browser/templates/divider.pt	2008-02-03 19:04:28 UTC (rev 83460)
@@ -1,6 +1,3 @@
 <div id="portal-header-divider">
-    <p>
-        <a href="#" title="">We should decide what links to put to this
-           divider viewlet.</a>
-    </p>
+    <tal:divider replace="structure view/divider" />
 </div>
\ No newline at end of file

Modified: zopeorg.theme/trunk/zopeorg/theme/browser/templates/feature.pt
===================================================================
--- zopeorg.theme/trunk/zopeorg/theme/browser/templates/feature.pt	2008-02-03 18:44:46 UTC (rev 83459)
+++ zopeorg.theme/trunk/zopeorg/theme/browser/templates/feature.pt	2008-02-03 19:04:28 UTC (rev 83460)
@@ -1,10 +1,9 @@
 <div id="portal-feature"
      i18n:domain="zopeorg.theme">
-     <p>
-         Zope is an open source framework for building web applications. That
-         applications commonly use the <a href="http://python.org"
-         title="Visit main Python web site">Python</a> programming
-         language.<br /> Built over a decade, Zope is leading in flexibility,
-         scalability and reusability.
-     </p>     
+     
+     <img tal:replace="structure python:view.tag(scale='mini', css_class='featureImage')" src="" alt="" />
+     
+     <div id="feature-blurb">
+         <tal:blurb replace="structure view/blurb" />
+     </div>
 </div>
\ No newline at end of file

Modified: zopeorg.theme/trunk/zopeorg/theme/browser/viewlets.py
===================================================================
--- zopeorg.theme/trunk/zopeorg/theme/browser/viewlets.py	2008-02-03 18:44:46 UTC (rev 83459)
+++ zopeorg.theme/trunk/zopeorg/theme/browser/viewlets.py	2008-02-03 19:04:28 UTC (rev 83460)
@@ -7,24 +7,21 @@
 
 class FeatureViewlet(ViewletBase):
     render = ViewPageTemplateFile('templates/feature.pt')
+        
+    def tag(self, **kwargs):
+        return self.context.getField('image').tag(self.context, **kwargs)
     
-    # def update(self):
-    #     self.portal_state = getMultiAdapter((self.context, self.request),
-    #                                         name=u'plone_portal_state')
-    #     self.portal_url = self.portal_state.portal_url()
-    #     url_tool = getToolByName(self.context, 'portal_url')
-    #     contentPath = url_tool.getRelativeContentPath(self.context)
-    #     
-    #     if contentPath:
-    #         self.section = 'default'
-    #     else:
-    #         self.section = contentPath[0]
+    def blurb(self):
+        return self.context.getBlurb()
+        
+class ZopeorgHeaderDividerViewlet(ViewletBase):
+    render = ViewPageTemplateFile('templates/divider.pt')  
     
+    def divider(self):
+        return self.context.getDivider()      
+    
 class ZopeorgSearchBoxViewlet(SearchBoxViewlet):
     render = ViewPageTemplateFile('templates/searchbox.pt')
     
 class ZopeorgPersonalBarViewlet(PersonalBarViewlet):
-    render = ViewPageTemplateFile('templates/anonymous_personal_bar.pt')    
-    
-class ZopeorgHeaderDividerViewlet(ViewletBase):
-    render = ViewPageTemplateFile('templates/divider.pt')    
\ No newline at end of file
+    render = ViewPageTemplateFile('templates/anonymous_personal_bar.pt')        
\ No newline at end of file



More information about the Checkins mailing list