web/views/basecomponents.py
changeset 6477 a91f3541b3dd
parent 6475 e58e08069c68
child 6669 e4532c6acf34
equal deleted inserted replaced
6476:de7f53cf75ec 6477:a91f3541b3dd
   248         self.w(u' | '.join(html))
   248         self.w(u' | '.join(html))
   249         self.w(u'</div>')
   249         self.w(u'</div>')
   250 
   250 
   251 # contextual components ########################################################
   251 # contextual components ########################################################
   252 
   252 
   253 class SeeAlsoComponent(component.RelatedObjectsCtxComponent):
       
   254     """display any entity's see also"""
       
   255     __regid__ = 'seealso'
       
   256     context = 'navcontentbottom'
       
   257     rtype = 'see_also'
       
   258     role = 'subject'
       
   259     order = 40
       
   260     title = _('see_also')
       
   261     # register msg not generated since no entity use see_also in cubicweb itself
       
   262     _('ctxcomponents_seealso')
       
   263     _('ctxcomponents_seealso_description')
       
   264 
       
   265 
       
   266 
   253 
   267 class MetaDataComponent(component.EntityCtxComponent):
   254 class MetaDataComponent(component.EntityCtxComponent):
   268     __regid__ = 'metadata'
   255     __regid__ = 'metadata'
   269     context = 'navbottom'
   256     context = 'navbottom'
   270     order = 1
   257     order = 1
   285                                                 view.domid))
   272                                                 view.domid))
   286             with wrap_on_write(w, '<h4>') as wow:
   273             with wrap_on_write(w, '<h4>') as wow:
   287                 view.render_title(wow)
   274                 view.render_title(wow)
   288             view.render_body(w)
   275             view.render_body(w)
   289             w(u'</div>\n')
   276             w(u'</div>\n')
   290 
       
   291 
       
   292 def registration_callback(vreg):
       
   293     vreg.register_all(globals().values(), __name__, (SeeAlsoComponent,))
       
   294     if 'see_also' in vreg.schema:
       
   295         vreg.register(SeeAlsoComponent)
       
   296         uicfg.primaryview_section.tag_subject_of(('*', 'see_also', '*'), 'hidden')