web/views/baseviews.py
changeset 919 dfeb9a986856
parent 608 7433011bb811
child 922 64962f22df2b
equal deleted inserted replaced
915:d7f85fd197df 919:dfeb9a986856
   241     def render_side_related(self, entity, siderelations):
   241     def render_side_related(self, entity, siderelations):
   242         """display side related relations:
   242         """display side related relations:
   243         non-meta in a first step, meta in a second step
   243         non-meta in a first step, meta in a second step
   244         """
   244         """
   245         if hasattr(self, 'get_side_boxes_defs'):
   245         if hasattr(self, 'get_side_boxes_defs'):
   246             for label, rset in self.get_side_boxes_defs(entity):
   246             if rset:
   247                 if rset:
   247                 self.w(u'<table align="right" with="100%">')
       
   248                 print 'u'*80
       
   249                 print 'right'
       
   250                 for label, rset in self.get_side_boxes_defs(entity):
       
   251                     self.w(u'<tr><td>')
   248                     self.w(u'<div class="sideRelated">')
   252                     self.w(u'<div class="sideRelated">')
   249                     self.wview('sidebox', rset, title=label)
   253                     self.wview('sidebox', rset, title=label)
   250                     self.w(u'</div>')
   254                     self.w(u'</div>')
       
   255                     self.w(u'</td></tr>')
       
   256                 self.w(u'</table>')
   251         elif siderelations:
   257         elif siderelations:
   252             self.w(u'<div class="sideRelated">')
   258             self.w(u'<div class="sideRelated">')
   253             for relatedinfos in siderelations:
   259             for relatedinfos in siderelations:
   254                 # if not relatedinfos[0].meta:
   260                 # if not relatedinfos[0].meta:
   255                 #    continue
   261                 #    continue
   256                 self._render_related_entities(entity, *relatedinfos)
   262                 self._render_related_entities(entity, *relatedinfos)
   257             self.w(u'</div>')
   263             self.w(u'</div>')
       
   264         self.w(u'<table  align="right" with="100%">')
   258         for box in self.vreg.possible_vobjects('boxes', self.req, self.rset,
   265         for box in self.vreg.possible_vobjects('boxes', self.req, self.rset,
   259                                                row=self.row, view=self,
   266                                                row=self.row, view=self,
   260                                                context='incontext'):
   267                                                context='incontext'):
       
   268             self.w(u'<tr><td>')
   261             try:
   269             try:
   262                 box.dispatch(w=self.w, row=self.row)
   270                 box.dispatch(w=self.w, row=self.row)
   263             except NotImplementedError:
   271             except NotImplementedError:
   264                 # much probably a context insensitive box, which only implements
   272                 # much probably a context insensitive box, which only implements
   265                 # .call() and not cell_call()
   273                 # .call() and not cell_call()
   266                 box.dispatch(w=self.w)
   274                 box.dispatch(w=self.w)
       
   275             self.w(u'</td></tr>')
       
   276         self.w(u'</table>')
   267                 
   277                 
   268     def is_side_related(self, rschema, eschema):
   278     def is_side_related(self, rschema, eschema):
   269         return rschema.meta and \
   279         return rschema.meta and \
   270                not rschema.schema_relation() == eschema.schema_entity()
   280                not rschema.schema_relation() == eschema.schema_entity()
   271 
   281