web/views/navigation.py
branchtls-sprint
changeset 692 800592b8d39b
parent 588 f37ee42cd0e9
child 742 99115e029dca
equal deleted inserted replaced
691:35133d86970b 692:800592b8d39b
     1 """navigation components definition for CubicWeb web client
     1 """navigation components definition for CubicWeb web client
     2 
     2 
     3 :organization: Logilab
     3 :organization: Logilab
     4 :copyright: 2001-2008 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
     4 :copyright: 2001-2009 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
     5 :contact: http://www.logilab.fr/ -- mailto:contact@logilab.fr
     5 :contact: http://www.logilab.fr/ -- mailto:contact@logilab.fr
     6 """
     6 """
     7 __docformat__ = "restructuredtext en"
     7 __docformat__ = "restructuredtext en"
     8 
     8 
     9 from rql.nodes import VariableRef, Constant
     9 from rql.nodes import VariableRef, Constant
    10 
    10 
    11 from logilab.mtconverter import html_escape
    11 from logilab.mtconverter import html_escape
    12 
    12 
    13 from cubicweb.interfaces import IPrevNext
    13 from cubicweb.interfaces import IPrevNext
    14 from cubicweb.common.selectors import (paginated_rset, sorted_rset,
    14 from cubicweb.selectors import (paginated_rset, sorted_rset,
    15                                        primary_view, match_context_prop,
    15                                 primary_view, match_context_prop,
    16                                        one_line_rset, implement_interface)
    16                                 one_line_rset, implements)
    17 from cubicweb.common.uilib import cut
    17 from cubicweb.common.uilib import cut
    18 from cubicweb.web.component import EntityVComponent, NavigationComponent
    18 from cubicweb.web.component import EntityVComponent, NavigationComponent
    19 
    19 
    20 _ = unicode
    20 _ = unicode
    21 
    21 
   179     # register msg not generated since no entity implements IPrevNext in cubicweb
   179     # register msg not generated since no entity implements IPrevNext in cubicweb
   180     # itself
   180     # itself
   181     title = _('contentnavigation_prevnext')
   181     title = _('contentnavigation_prevnext')
   182     help = _('contentnavigation_prevnext_description')
   182     help = _('contentnavigation_prevnext_description')
   183     __selectors__ = (one_line_rset, primary_view,
   183     __selectors__ = (one_line_rset, primary_view,
   184                      match_context_prop, implement_interface)
   184                      match_context_prop, implements(IPrevNext))
   185     accepts_interfaces = (IPrevNext,)
       
   186     context = 'navbottom'
   185     context = 'navbottom'
   187     order = 10
   186     order = 10
   188     def call(self, view=None):
   187     def call(self, view=None):
   189         entity = self.entity(0)
   188         entity = self.entity(0)
   190         previous = entity.previous_entity()
   189         previous = entity.previous_entity()