web/views/tabs.py
changeset 999 999198995a53
parent 923 7c184924d492
parent 997 ee71c2ba73e6
child 1000 90705536b7c8
equal deleted inserted replaced
994:98f19cf755a1 999:999198995a53
     1 """base classes to handle tabbed views
     1 """base classes to handle tabbed views
     2 
     2 
     3 :organization: Logilab
     3 :organization: Logilab
     4 :copyright: 2008 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
     4 :copyright: 2008-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 
     7 
     8 __docformat__ = "restructuredtext en"
     8 __docformat__ = "restructuredtext en"
     9 
     9 
    88 
    88 
    89     def render_tabs(self, tabs, default, entity):
    89     def render_tabs(self, tabs, default, entity):
    90         self.req.add_css('ui.tabs.css')
    90         self.req.add_css('ui.tabs.css')
    91         self.req.add_js(('ui.core.js', 'ui.tabs.js',
    91         self.req.add_js(('ui.core.js', 'ui.tabs.js',
    92                          'cubicweb.ajax.js', 'cubicweb.tabs.js', 'cubicweb.lazy.js'))
    92                          'cubicweb.ajax.js', 'cubicweb.tabs.js', 'cubicweb.lazy.js'))
       
    93         # tabbed views do no support concatenation
       
    94         # hence we delegate to the default tab
       
    95         if self.req.form.get('vid') == 'primary':
       
    96             entity.view(default)
       
    97             return
    93         # prune tabs : not all are to be shown
    98         # prune tabs : not all are to be shown
    94         tabs = self.prune_tabs(tabs)
    99         tabs = self.prune_tabs(tabs)
    95         # select a tab
   100         # select a tab
    96         active_tab = self.active_tab(tabs, default)
   101         active_tab = self.active_tab(tabs, default)
    97         # build the html structure
   102         # build the html structure