web/views/baseviews.py
branchtls-sprint
changeset 631 99f5852f8604
parent 608 7433011bb811
child 632 3a394a90b702
equal deleted inserted replaced
630:66ff0b2f7d03 631:99f5852f8604
    27                                        match_form_params, accept_rset)
    27                                        match_form_params, accept_rset)
    28 from cubicweb.common.uilib import (cut, printable_value,  UnicodeCSVWriter,
    28 from cubicweb.common.uilib import (cut, printable_value,  UnicodeCSVWriter,
    29                                    ajax_replace_url, rql_for_eid, simple_sgml_tag)
    29                                    ajax_replace_url, rql_for_eid, simple_sgml_tag)
    30 from cubicweb.common.view import EntityView, AnyRsetView, EmptyRsetView
    30 from cubicweb.common.view import EntityView, AnyRsetView, EmptyRsetView
    31 from cubicweb.web.httpcache import MaxAgeHTTPCacheManager
    31 from cubicweb.web.httpcache import MaxAgeHTTPCacheManager
    32 from cubicweb.web.views import vid_from_rset, linksearch_select_url, linksearch_match
    32 from cubicweb.web.views import vid_from_rset, linksearch_select_url
    33 
    33 
    34 _ = unicode
    34 _ = unicode
    35 
    35 
    36 class NullView(AnyRsetView):
    36 class NullView(AnyRsetView):
    37     """default view when no result has been found"""
    37     """default view when no result has been found"""
   824 class OutOfContextSearch(EntityView):
   824 class OutOfContextSearch(EntityView):
   825     id = 'outofcontext-search'
   825     id = 'outofcontext-search'
   826     def cell_call(self, row, col):
   826     def cell_call(self, row, col):
   827         entity = self.entity(row, col)
   827         entity = self.entity(row, col)
   828         erset = entity.as_rset()
   828         erset = entity.as_rset()
   829         if linksearch_match(self.req, erset):
   829         if self.req.match_search_state(erset):
   830             self.w(u'<a href="%s" title="%s">%s</a>&nbsp;<a href="%s" title="%s">[...]</a>' % (
   830             self.w(u'<a href="%s" title="%s">%s</a>&nbsp;<a href="%s" title="%s">[...]</a>' % (
   831                 html_escape(linksearch_select_url(self.req, erset)),
   831                 html_escape(linksearch_select_url(self.req, erset)),
   832                 self.req._('select this entity'),
   832                 self.req._('select this entity'),
   833                 html_escape(entity.view('textoutofcontext')),
   833                 html_escape(entity.view('textoutofcontext')),
   834                 html_escape(entity.absolute_url(vid='primary')),
   834                 html_escape(entity.absolute_url(vid='primary')),