web/views/basetemplates.py
changeset 2800 31c3a045e04d
parent 2770 356e9d7c356d
child 2813 0cf6c8005bf6
--- a/web/views/basetemplates.py	Thu Aug 13 09:59:35 2009 +0200
+++ b/web/views/basetemplates.py	Thu Aug 13 10:02:18 2009 +0200
@@ -113,9 +113,9 @@
         if vtitle:
             w(u'<h1 class="vtitle">%s</h1>\n' % xml_escape(vtitle))
         # display entity type restriction component
-        etypefilter = self.vreg['components'].select_vobject(
+        etypefilter = self.vreg['components'].select_or_none(
             'etypenavigation', self.req, rset=self.rset)
-        if etypefilter:
+        if etypefilter and etypefilter.propval('visible'):
             etypefilter.render(w=w)
         self.nav_html = UStringIO()
         if view and view.need_navigation:
@@ -256,9 +256,9 @@
             w(u'<h1 class="vtitle">%s</h1>' % xml_escape(vtitle))
 
     def topleft_header(self):
-        logo = self.vreg['components'].select_vobject('logo', self.req,
+        logo = self.vreg['components'].select_or_none('logo', self.req,
                                                       rset=self.rset)
-        if logo:
+        if logo and logo.propval('visible'):
             self.w(u'<table id="header"><tr>\n')
             self.w(u'<td>')
             logo.render(w=self.w)
@@ -328,29 +328,29 @@
         """build the top menu with authentification info and the rql box"""
         self.w(u'<table id="header"><tr>\n')
         self.w(u'<td id="firstcolumn">')
-        logo = self.vreg['components'].select_vobject(
+        logo = self.vreg['components'].select_or_none(
             'logo', self.req, rset=self.rset)
-        if logo:
+        if logo and logo.propval('visible'):
             logo.render(w=self.w)
         self.w(u'</td>\n')
         # appliname and breadcrumbs
         self.w(u'<td id="headtext">')
         for cid in ('appliname', 'breadcrumbs'):
-            comp = self.vreg['components'].select_vobject(
+            comp = self.vreg['components'].select_or_none(
                 cid, self.req, rset=self.rset)
-            if comp:
+            if comp and comp.propval('visible'):
                 comp.render(w=self.w)
         self.w(u'</td>')
         # logged user and help
         self.w(u'<td>\n')
-        comp = self.vreg['components'].select_vobject(
+        comp = self.vreg['components'].select_or_none(
             'loggeduserlink', self.req, rset=self.rset)
-        if comp:
+        if comp and comp.propval('visible'):
             comp.render(w=self.w)
         self.w(u'</td><td>')
-        helpcomp = self.vreg['components'].select_vobject(
+        helpcomp = self.vreg['components'].select_or_none(
             'help', self.req, rset=self.rset)
-        if helpcomp:
+        if helpcomp and helpcomp.propval('visible'):
             helpcomp.render(w=self.w)
         self.w(u'</td>')
         # lastcolumn