web/views/ibreadcrumbs.py
changeset 3185 bd0126d17e83
parent 3090 8184bec7414d
parent 3184 613064b49331
child 3377 dd9d292b6a6d
equal deleted inserted replaced
3163:edfe43ceaa35 3185:bd0126d17e83
    54             self.wpath_part(parent, contextentity, i == len(path) - 1)
    54             self.wpath_part(parent, contextentity, i == len(path) - 1)
    55 
    55 
    56     def wpath_part(self, part, contextentity, last=False):
    56     def wpath_part(self, part, contextentity, last=False):
    57         if isinstance(part, Entity):
    57         if isinstance(part, Entity):
    58             if last and part.eid == contextentity.eid:
    58             if last and part.eid == contextentity.eid:
    59                 part.view('breadcrumbtext', w=self.w)
    59                 self.w(xml_escape(part.view('breadcrumbtext')))
    60             else:
    60             else:
    61                 part.view('breadcrumbs', w=self.w)
    61                 self.w(part.view('breadcrumbs'))
    62         elif isinstance(part, tuple):
    62         elif isinstance(part, tuple):
    63             url, title = part
    63             url, title = part
    64             textsize = self.req.property_value('navigation.short-line-size')
    64             textsize = self.req.property_value('navigation.short-line-size')
    65             self.w(u'<a href="%s">%s</a>' % (
    65             self.w(u'<a href="%s">%s</a>' % (
    66                 xml_escape(url), xml_escape(uilib.cut(title, textsize))))
    66                 xml_escape(url), xml_escape(uilib.cut(title, textsize))))
    97     id = 'breadcrumbs'
    97     id = 'breadcrumbs'
    98 
    98 
    99     def cell_call(self, row, col):
    99     def cell_call(self, row, col):
   100         entity = self.rset.get_entity(row, col)
   100         entity = self.rset.get_entity(row, col)
   101         desc = xml_escape(uilib.cut(entity.dc_description(), 50))
   101         desc = xml_escape(uilib.cut(entity.dc_description(), 50))
   102         self.w(tags.a(entity.view('breadcrumbtext'), href=entity.absolute_url(),
   102         # XXX remember camember : tags.a autoescapes !
   103                       title=desc))
   103         self.w(tags.a(entity.view('breadcrumbtext'),
       
   104                       href=entity.absolute_url(), title=desc))
   104 
   105 
   105 
   106 
   106 class BreadCrumbTextView(EntityView):
   107 class BreadCrumbTextView(EntityView):
   107     id = 'breadcrumbtext'
   108     id = 'breadcrumbtext'
   108 
   109