web/views/baseviews.py
changeset 991 746fed01d1e0
parent 988 b73f3cd23d43
child 1006 92a0601b2523
child 1125 1fbeb11a27a3
equal deleted inserted replaced
990:5f1ff5b6907a 991:746fed01d1e0
   156         siderelations = []
   156         siderelations = []
   157         self.render_entity_title(entity)
   157         self.render_entity_title(entity)
   158         self.render_entity_metadata(entity)
   158         self.render_entity_metadata(entity)
   159         # entity's attributes and relations, excluding meta data
   159         # entity's attributes and relations, excluding meta data
   160         # if the entity isn't meta itself
   160         # if the entity isn't meta itself
   161         #self.w(u'<table border="0" width="100%">')
       
   162         #self.w(u'<tr>')
       
   163         #self.w(u'<td valign="top">')
       
   164         self.w(u'<div>')
   161         self.w(u'<div>')
   165         self.w(u'<div class="mainInfo">')
   162         self.w(u'<div class="mainInfo">')
   166         self.render_entity_attributes(entity, siderelations)
   163         self.render_entity_attributes(entity, siderelations)
   167         self.w(u'</div>')
   164         self.w(u'</div>')
   168         self.content_navigation_components('navcontenttop')
   165         self.content_navigation_components('navcontenttop')
   169         if self.main_related_section:
   166         if self.main_related_section:
   170             self.render_entity_relations(entity, siderelations)
   167             self.render_entity_relations(entity, siderelations)
   171         self.w(u'</div>')
   168         self.w(u'</div>')
   172         #self.w(u'</td>')
       
   173         # side boxes
   169         # side boxes
   174         #self.w(u'<td valign="top">')
       
   175         self.w(u'<div class="primaryRight">')
   170         self.w(u'<div class="primaryRight">')
   176         self.render_side_related(entity, siderelations)
   171         self.render_side_related(entity, siderelations)
   177         self.w(u'</div>')
   172         self.w(u'</div>')
   178         self.w(u'<div class="clear"></div>')#verifier
   173         self.w(u'<div class="clear"></div>')          
   179         #self.w(u'</td>')
       
   180         #self.w(u'</tr>')
       
   181         #self.w(u'</table>')        
       
   182         self.content_navigation_components('navcontentbottom')
   174         self.content_navigation_components('navcontentbottom')
   183 
   175 
   184     def content_navigation_components(self, context):
   176     def content_navigation_components(self, context):
   185         self.w(u'<div class="%s">' % context)
   177         self.w(u'<div class="%s">' % context)
   186         for comp in self.vreg.possible_vobjects('contentnavigation',
   178         for comp in self.vreg.possible_vobjects('contentnavigation',
   269         """
   261         """
   270         if hasattr(self, 'get_side_boxes_defs'):
   262         if hasattr(self, 'get_side_boxes_defs'):
   271             sideboxes = [(label, rset) for label, rset in self.get_side_boxes_defs(entity)
   263             sideboxes = [(label, rset) for label, rset in self.get_side_boxes_defs(entity)
   272                          if rset]
   264                          if rset]
   273             if sideboxes:
   265             if sideboxes:
   274                 #self.w(u'<table width="100%">')
       
   275                 for label, rset in sideboxes:
   266                 for label, rset in sideboxes:
   276                     #self.w(u'<tr><td>')
       
   277                     self.w(u'<div class="sideRelated">')
   267                     self.w(u'<div class="sideRelated">')
   278                     self.wview('sidebox', rset, title=label)
   268                     self.wview('sidebox', rset, title=label)
   279                     self.w(u'</div>')
   269                     self.w(u'</div>')
   280                     #self.w(u'</td></tr>')
       
   281                 #self.w(u'</table>')
       
   282         elif siderelations:
   270         elif siderelations:
   283             #self.w(u'<table width="100%">')
       
   284             #self.w(u'<tr><td>')
       
   285             self.w(u'<div class="sideRelated">')
   271             self.w(u'<div class="sideRelated">')
   286             for relatedinfos in siderelations:
   272             for relatedinfos in siderelations:
   287                 # if not relatedinfos[0].meta:
   273                 # if not relatedinfos[0].meta:
   288                 #    continue
   274                 #    continue
   289                 self._render_related_entities(entity, *relatedinfos)
   275                 self._render_related_entities(entity, *relatedinfos)
   290             self.w(u'</div>')
   276             self.w(u'</div>')
   291             #self.w(u'</td></tr>')
       
   292             #self.w(u'</table>')
       
   293         boxes = list(self.vreg.possible_vobjects('boxes', self.req, self.rset,
   277         boxes = list(self.vreg.possible_vobjects('boxes', self.req, self.rset,
   294                                                  row=self.row, view=self,
   278                                                  row=self.row, view=self,
   295                                                  context='incontext'))
   279                                                  context='incontext'))
   296         if boxes:
   280         if boxes:
   297             #self.w(u'<table width="100%">')
       
   298             for box in boxes:
   281             for box in boxes:
   299                 #self.w(u'<tr><td>')
       
   300                 try:
   282                 try:
   301                     box.dispatch(w=self.w, row=self.row)
   283                     box.dispatch(w=self.w, row=self.row)
   302                 except NotImplementedError:
   284                 except NotImplementedError:
   303                     # much probably a context insensitive box, which only implements
   285                     # much probably a context insensitive box, which only implements
   304                     # .call() and not cell_call()
   286                     # .call() and not cell_call()
   305                     box.dispatch(w=self.w)
   287                     box.dispatch(w=self.w)               
   306                 #self.w(u'</td></tr>')
       
   307             #self.w(u'</table>')
       
   308                 
   288                 
   309     def is_side_related(self, rschema, eschema):
   289     def is_side_related(self, rschema, eschema):
   310         return rschema.meta and \
   290         return rschema.meta and \
   311                not rschema.schema_relation() == eschema.schema_entity()
   291                not rschema.schema_relation() == eschema.schema_entity()
   312 
   292