web/component.py
changeset 5715 2c3e83817a8e
parent 5624 865c1779cc84
child 5910 432c657ebfec
equal deleted inserted replaced
5714:04a8e48f10bc 5715:2c3e83817a8e
    13 # FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public License for more
    13 # FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public License for more
    14 # details.
    14 # details.
    15 #
    15 #
    16 # You should have received a copy of the GNU Lesser General Public License along
    16 # You should have received a copy of the GNU Lesser General Public License along
    17 # with CubicWeb.  If not, see <http://www.gnu.org/licenses/>.
    17 # with CubicWeb.  If not, see <http://www.gnu.org/licenses/>.
    18 """abstract component class and base components definition for CubicWeb web client
    18 """abstract component class and base components definition for CubicWeb web
    19 
    19 client
    20 """
    20 """
       
    21 
    21 __docformat__ = "restructuredtext en"
    22 __docformat__ = "restructuredtext en"
    22 _ = unicode
    23 _ = unicode
    23 
    24 
    24 from logilab.common.deprecation import class_renamed
    25 from logilab.common.deprecation import class_renamed
    25 from logilab.mtconverter import xml_escape
    26 from logilab.mtconverter import xml_escape
    59     }
    60     }
    60 
    61 
    61     context = 'navcontentbottom'
    62     context = 'navcontentbottom'
    62 
    63 
    63     def call(self, view=None):
    64     def call(self, view=None):
    64         return self.cell_call(0, 0, view=view)
    65         if self.cw_rset is None:
       
    66             self.entity_call(self.cw_extra_kwargs.pop('entity'))
       
    67         else:
       
    68             self.cell_call(0, 0, view=view)
    65 
    69 
    66     def cell_call(self, row, col, view=None):
    70     def cell_call(self, row, col, view=None):
       
    71         self.entity_call(self.cw_rset.get_entity(row, col), view=view)
       
    72 
       
    73     def entity_call(self, entity, view=None):
    67         raise NotImplementedError()
    74         raise NotImplementedError()
    68 
    75 
    69 
    76 
    70 class NavigationComponent(Component):
    77 class NavigationComponent(Component):
    71     """abstract base class for navigation components"""
    78     """abstract base class for navigation components"""