web/views/boxes.py
changeset 6479 16a402e91a54
parent 6409 d75535983224
child 6526 2f3ded081142
equal deleted inserted replaced
6478:8098e1295cf0 6479:16a402e91a54
   220 
   220 
   221     def render_title(self, w):
   221     def render_title(self, w):
   222         w(self.cw_extra_kwargs['title'])
   222         w(self.cw_extra_kwargs['title'])
   223 
   223 
   224     def render_body(self, w):
   224     def render_body(self, w):
   225         self._cw.view(self.cw_extra_kwargs['vid'], self.cw_rset, w=w)
   225         if 'dispctrl' in self.cw_extra_kwargs:
       
   226             # XXX do not modify dispctrl!
       
   227             self.cw_extra_kwargs['dispctrl'].setdefault('subvid', 'outofcontext')
       
   228             self.cw_extra_kwargs['dispctrl'].setdefault('use_list_limit', 1)
       
   229         self._cw.view(self.cw_extra_kwargs['vid'], self.cw_rset, w=w,
       
   230                       initargs=self.cw_extra_kwargs)
   226 
   231 
   227  # helper classes ##############################################################
   232  # helper classes ##############################################################
   228 
   233 
   229 class SideBoxView(EntityView):
   234 class SideBoxView(EntityView):
   230     """helper view class to display some entities in a sidebox"""
   235     """helper view class to display some entities in a sidebox"""
   236     def call(self, **kwargs):
   241     def call(self, **kwargs):
   237         """display a list of entities by calling their <item_vid> view"""
   242         """display a list of entities by calling their <item_vid> view"""
   238         if 'dispctrl' in self.cw_extra_kwargs:
   243         if 'dispctrl' in self.cw_extra_kwargs:
   239             # XXX do not modify dispctrl!
   244             # XXX do not modify dispctrl!
   240             self.cw_extra_kwargs['dispctrl'].setdefault('subvid', 'outofcontext')
   245             self.cw_extra_kwargs['dispctrl'].setdefault('subvid', 'outofcontext')
       
   246             self.cw_extra_kwargs['dispctrl'].setdefault('use_list_limit', 1)
   241         box = self._cw.vreg['ctxcomponents'].select(
   247         box = self._cw.vreg['ctxcomponents'].select(
   242             'rsetbox', self._cw, rset=self.cw_rset, vid='autolimited',
   248             'rsetbox', self._cw, rset=self.cw_rset, vid='autolimited',
   243             title=title, **self.cw_extra_kwargs)
   249             title=title, **self.cw_extra_kwargs)
   244         box.render(self.w)
   250         box.render(self.w)
   245 
   251