cubicweb/web/views/basecomponents.py
author Denis Laxalde <denis.laxalde@logilab.fr>
Thu, 21 Mar 2019 14:33:54 +0100
changeset 12530 9d88e1177c35
parent 12494 3c2f104638dd
permissions -rw-r--r--
Remove Twisted web server Twisted web server is not used anymore and has been superseded by pyramid many years ago. Furthermore, our usage is not compatible with Python 3. So we drop the "etwist" sub-package. As a consequence, "all-in-one" configuration type gets dropped as it was Twisted-specific. We resurrect it in cubicweb/pyramid/config.py by only keeping options used by the "pyramid". Similarly, we introduce a AllInOneCreateHandler in cubicweb/pyramid/pyramidctl.py that is basically the one that lived in cubicweb/etwist/twctl.py and is used to create the "all-in-one" instance. Added a TODO here about "pyramid.ini" that could be generated at the end of bootstrap() method. In cubicweb/devtools/httptest.py, CubicWebServerTC is now equivalent to CubicWebWsgiTC and the latter is dropped.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
9445
65d93a4fd11c [multi-sources-removal] Drop pyrorql and zmqrql sources
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 8694
diff changeset
     1
# copyright 2003-2013 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
5421
8167de96c523 proper licensing information (LGPL-2.1). Hope I get it right this time.
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 5148
diff changeset
     2
# contact http://www.logilab.fr/ -- mailto:contact@logilab.fr
8167de96c523 proper licensing information (LGPL-2.1). Hope I get it right this time.
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 5148
diff changeset
     3
#
8167de96c523 proper licensing information (LGPL-2.1). Hope I get it right this time.
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 5148
diff changeset
     4
# This file is part of CubicWeb.
8167de96c523 proper licensing information (LGPL-2.1). Hope I get it right this time.
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 5148
diff changeset
     5
#
8167de96c523 proper licensing information (LGPL-2.1). Hope I get it right this time.
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 5148
diff changeset
     6
# CubicWeb is free software: you can redistribute it and/or modify it under the
8167de96c523 proper licensing information (LGPL-2.1). Hope I get it right this time.
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 5148
diff changeset
     7
# terms of the GNU Lesser General Public License as published by the Free
8167de96c523 proper licensing information (LGPL-2.1). Hope I get it right this time.
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 5148
diff changeset
     8
# Software Foundation, either version 2.1 of the License, or (at your option)
8167de96c523 proper licensing information (LGPL-2.1). Hope I get it right this time.
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 5148
diff changeset
     9
# any later version.
8167de96c523 proper licensing information (LGPL-2.1). Hope I get it right this time.
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 5148
diff changeset
    10
#
5424
8ecbcbff9777 replace logilab-common by CubicWeb in disclaimer
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 5421
diff changeset
    11
# CubicWeb is distributed in the hope that it will be useful, but WITHOUT
5421
8167de96c523 proper licensing information (LGPL-2.1). Hope I get it right this time.
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 5148
diff changeset
    12
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
8167de96c523 proper licensing information (LGPL-2.1). Hope I get it right this time.
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 5148
diff changeset
    13
# FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public License for more
8167de96c523 proper licensing information (LGPL-2.1). Hope I get it right this time.
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 5148
diff changeset
    14
# details.
8167de96c523 proper licensing information (LGPL-2.1). Hope I get it right this time.
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 5148
diff changeset
    15
#
8167de96c523 proper licensing information (LGPL-2.1). Hope I get it right this time.
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 5148
diff changeset
    16
# You should have received a copy of the GNU Lesser General Public License along
8167de96c523 proper licensing information (LGPL-2.1). Hope I get it right this time.
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 5148
diff changeset
    17
# with CubicWeb.  If not, see <http://www.gnu.org/licenses/>.
0
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    18
"""Bases HTML components:
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    19
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    20
* the rql input form
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    21
* the logged user link
5854
b49f58a320e6 cleanup
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 5819
diff changeset
    22
"""
11767
432f87a63057 flake8 and all
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 11057
diff changeset
    23
10666
7f6b5f023884 [py3k] replace '_ = unicode' in global scope (closes #7589459)
Rémi Cardona <remi.cardona@logilab.fr>
parents: 10313
diff changeset
    24
from cubicweb import _
0
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    25
2313
2940c2341ae4 fix import
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 2312
diff changeset
    26
from logilab.mtconverter import xml_escape
8190
2a3c1b787688 [vreg] move base registry implementation to logilab.common. Closes #1916014
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 8080
diff changeset
    27
from logilab.common.registry import yes
6396
a9e4c51fc1c1 [login ui] cleanup and somewhat bw compat
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 6389
diff changeset
    28
from logilab.common.deprecation import class_renamed
0
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    29
12494
3c2f104638dd [web] removed unused imports in basecomponents
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents: 11875
diff changeset
    30
from cubicweb.predicates import (match_context, configuration_values,
8190
2a3c1b787688 [vreg] move base registry implementation to logilab.common. Closes #1916014
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 8080
diff changeset
    31
                                 anonymous_user, authenticated_user)
6141
b8287e54b528 [web api] unify 'contentnav' (VComponent) and 'boxes' registries as 'ctxcomponents' (CtxComponent)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 6140
diff changeset
    32
from cubicweb.utils import wrap_on_write
4023
eae23c40627a drop common subpackage
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 4004
diff changeset
    33
from cubicweb.uilib import toggle_action
8665
e65af61bde7d [uicfg] uicfg.py moves from web/ to web/views/ (prepares #2406609)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents: 8505
diff changeset
    34
from cubicweb.web import component
6800
3f3d576b87d9 [web action] refactor box menu handling, fixing #1401943 on the way
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 6678
diff changeset
    35
from cubicweb.web.htmlwidgets import MenuWidget, PopupBoxMenu
0
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    36
1511
514e4e53a3c7 do not set visible property by default
sylvain.thenault@logilab.fr
parents: 1132
diff changeset
    37
VISIBLE_PROP_DEF = {
1968
d3de0f44b57b components should be visible by default, applmessages components should not be hideable
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 1937
diff changeset
    38
    _('visible'):  dict(type='Boolean', default=True,
1511
514e4e53a3c7 do not set visible property by default
sylvain.thenault@logilab.fr
parents: 1132
diff changeset
    39
                        help=_('display the component or not')),
514e4e53a3c7 do not set visible property by default
sylvain.thenault@logilab.fr
parents: 1132
diff changeset
    40
    }
0
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    41
1554
3a3263df6cdd new primary view using uicfg.rdisplay (major api cleanup)
sylvain.thenault@logilab.fr
parents: 1514
diff changeset
    42
class RQLInputForm(component.Component):
0
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    43
    """build the rql input form, usually displayed in the header"""
3377
dd9d292b6a6d use __regid__ instead of id on appobject classes
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 3185
diff changeset
    44
    __regid__ = 'rqlinput'
2799
b703639614e7 refactor property handling to avoid name conflicts
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 2650
diff changeset
    45
    cw_property_defs = VISIBLE_PROP_DEF
2120
ed1cd652b343 rqlinput should have its default visible property to false
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 2119
diff changeset
    46
    visible = False
2172
cf8f9180e63e delete-trailing-whitespace
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents: 2120
diff changeset
    47
0
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    48
    def call(self, view=None):
8044
8ea1ad44ecac [rqlinput] cleanup (use req everywhere) and fix html validation issue (input outside fieldset)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 7437
diff changeset
    49
        req = self._cw
0
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    50
        if hasattr(view, 'filter_box_context_info'):
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    51
            rset = view.filter_box_context_info()[0]
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    52
        else:
3451
6b46d73823f5 [api] work in progress, use __regid__, cw_*, etc.
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents: 3407
diff changeset
    53
            rset = self.cw_rset
0
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    54
        # display multilines query as one line
10313
ae9e23cf8790 [rset] Deprecate the 'encoded' argument to ResultSet.printable_rql()
Rémi Cardona <remi.cardona@free.fr>
parents: 10119
diff changeset
    55
        rql = rset is not None and rset.printable_rql() or req.form.get('rql', '')
0
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    56
        rql = rql.replace(u"\n", u" ")
8505
dcd9bc1d1bca [ui] provide an autocomplete RQL bar (closes #2439846)
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents: 8326
diff changeset
    57
        rql_suggestion_comp = self._cw.vreg['components'].select_or_none('rql.suggestions', self._cw)
dcd9bc1d1bca [ui] provide an autocomplete RQL bar (closes #2439846)
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents: 8326
diff changeset
    58
        if rql_suggestion_comp is not None:
dcd9bc1d1bca [ui] provide an autocomplete RQL bar (closes #2439846)
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents: 8326
diff changeset
    59
            # enable autocomplete feature only if the rql
dcd9bc1d1bca [ui] provide an autocomplete RQL bar (closes #2439846)
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents: 8326
diff changeset
    60
            # suggestions builder is available
dcd9bc1d1bca [ui] provide an autocomplete RQL bar (closes #2439846)
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents: 8326
diff changeset
    61
            self._cw.add_css('jquery.ui.css')
dcd9bc1d1bca [ui] provide an autocomplete RQL bar (closes #2439846)
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents: 8326
diff changeset
    62
            self._cw.add_js(('cubicweb.ajax.js', 'jquery.ui.js'))
dcd9bc1d1bca [ui] provide an autocomplete RQL bar (closes #2439846)
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents: 8326
diff changeset
    63
            self._cw.add_onload('$("#rql").autocomplete({source: "%s"});'
dcd9bc1d1bca [ui] provide an autocomplete RQL bar (closes #2439846)
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents: 8326
diff changeset
    64
                                % (req.build_url('json', fname='rql_suggest')))
8044
8ea1ad44ecac [rqlinput] cleanup (use req everywhere) and fix html validation issue (input outside fieldset)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 7437
diff changeset
    65
        self.w(u'''<div id="rqlinput" class="%s"><form action="%s"><fieldset>
11875
011730a4af73 [web] remove next_tabindex()
Julien Cristau <julien.cristau@logilab.fr>
parents: 11874
diff changeset
    66
<input type="text" id="rql" name="rql" value="%s"  title="%s" accesskey="q" class="searchField" />
2818
326375561412 propagate some api changes
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 2799
diff changeset
    67
''' % (not self.cw_propval('visible') and 'hidden' or '',
11875
011730a4af73 [web] remove next_tabindex()
Julien Cristau <julien.cristau@logilab.fr>
parents: 11874
diff changeset
    68
       req.build_url('view'), xml_escape(rql), req._('full text or RQL query')))
8044
8ea1ad44ecac [rqlinput] cleanup (use req everywhere) and fix html validation issue (input outside fieldset)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 7437
diff changeset
    69
        if req.search_state[0] != 'normal':
0
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    70
            self.w(u'<input type="hidden" name="__mode" value="%s"/>'
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    71
                   % ':'.join(req.search_state[1]))
8044
8ea1ad44ecac [rqlinput] cleanup (use req everywhere) and fix html validation issue (input outside fieldset)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 7437
diff changeset
    72
        self.w(u'</fieldset></form></div>')
0
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    73
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    74
1511
514e4e53a3c7 do not set visible property by default
sylvain.thenault@logilab.fr
parents: 1132
diff changeset
    75
6428
de95bbed8781 [components] refactor main template header: make it much more flexible by using CtxComponent
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 6396
diff changeset
    76
class HeaderComponent(component.CtxComponent): # XXX rename properly along with related context
5148
ec0ea7366066 [web components] refactor as book recommends :$
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 4935
diff changeset
    77
    """if the user is the anonymous user, build a link to login else display a menu
ec0ea7366066 [web components] refactor as book recommends :$
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 4935
diff changeset
    78
    with user'action (preference, logout, etc...)
0
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    79
    """
6389
72ba82a26e05 refactor login box & form to enable easy pluggability
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents: 6141
diff changeset
    80
    __abstract__ = True
6428
de95bbed8781 [components] refactor main template header: make it much more flexible by using CtxComponent
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 6396
diff changeset
    81
    cw_property_defs = component.override_ctx(
de95bbed8781 [components] refactor main template header: make it much more flexible by using CtxComponent
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 6396
diff changeset
    82
        component.CtxComponent,
8326
2e793b2cdb57 [view] breadcrumbs layout broken with long elements (closes #1347486)
Katia Saurfelt <katia.saurfelt@logilab.fr>
parents: 8244
diff changeset
    83
        vocabulary=['header-center', 'header-left', 'header-right', ])
1511
514e4e53a3c7 do not set visible property by default
sylvain.thenault@logilab.fr
parents: 1132
diff changeset
    84
    # don't want user to hide this component using an cwproperty
514e4e53a3c7 do not set visible property by default
sylvain.thenault@logilab.fr
parents: 1132
diff changeset
    85
    site_wide = True
8326
2e793b2cdb57 [view] breadcrumbs layout broken with long elements (closes #1347486)
Katia Saurfelt <katia.saurfelt@logilab.fr>
parents: 8244
diff changeset
    86
    context = _('header-center')
6428
de95bbed8781 [components] refactor main template header: make it much more flexible by using CtxComponent
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 6396
diff changeset
    87
de95bbed8781 [components] refactor main template header: make it much more flexible by using CtxComponent
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 6396
diff changeset
    88
de95bbed8781 [components] refactor main template header: make it much more flexible by using CtxComponent
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 6396
diff changeset
    89
class ApplLogo(HeaderComponent):
de95bbed8781 [components] refactor main template header: make it much more flexible by using CtxComponent
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 6396
diff changeset
    90
    """build the instance logo, usually displayed in the header"""
de95bbed8781 [components] refactor main template header: make it much more flexible by using CtxComponent
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 6396
diff changeset
    91
    __regid__ = 'logo'
7428
5338d895b891 [web session] fix session handling so we get a chance to have for instance the 'forgotpwd' feature working on a site where anonymous are not allowed
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 7101
diff changeset
    92
    __select__ = yes() # no need for a cnx
6428
de95bbed8781 [components] refactor main template header: make it much more flexible by using CtxComponent
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 6396
diff changeset
    93
    order = -1
8326
2e793b2cdb57 [view] breadcrumbs layout broken with long elements (closes #1347486)
Katia Saurfelt <katia.saurfelt@logilab.fr>
parents: 8244
diff changeset
    94
    context = _('header-left')
6428
de95bbed8781 [components] refactor main template header: make it much more flexible by using CtxComponent
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 6396
diff changeset
    95
de95bbed8781 [components] refactor main template header: make it much more flexible by using CtxComponent
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 6396
diff changeset
    96
    def render(self, w):
9760
7bc3e55d365e [views] new cubicweb logo (closes #3803681)
David Douard <david.douard@logilab.fr>
parents: 9552
diff changeset
    97
        w(u'<a id="logo" href="%s"></a>' % self._cw.base_url())
0
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    98
5148
ec0ea7366066 [web components] refactor as book recommends :$
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 4935
diff changeset
    99
6428
de95bbed8781 [components] refactor main template header: make it much more flexible by using CtxComponent
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 6396
diff changeset
   100
class ApplicationName(HeaderComponent):
de95bbed8781 [components] refactor main template header: make it much more flexible by using CtxComponent
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 6396
diff changeset
   101
    """display the instance name"""
de95bbed8781 [components] refactor main template header: make it much more flexible by using CtxComponent
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 6396
diff changeset
   102
    __regid__ = 'appliname'
de95bbed8781 [components] refactor main template header: make it much more flexible by using CtxComponent
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 6396
diff changeset
   103
7101
de388d0b727e [components] add **kwargs to render method of header components to make them usable as regular components (eg in other places than the header
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 6800
diff changeset
   104
    # XXX support kwargs for compat with other components which gets the view as
de388d0b727e [components] add **kwargs to render method of header components to make them usable as regular components (eg in other places than the header
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 6800
diff changeset
   105
    # argument
de388d0b727e [components] add **kwargs to render method of header components to make them usable as regular components (eg in other places than the header
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 6800
diff changeset
   106
    def render(self, w, **kwargs):
6428
de95bbed8781 [components] refactor main template header: make it much more flexible by using CtxComponent
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 6396
diff changeset
   107
        title = self._cw.property_value('ui.site-title')
de95bbed8781 [components] refactor main template header: make it much more flexible by using CtxComponent
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 6396
diff changeset
   108
        if title:
de95bbed8781 [components] refactor main template header: make it much more flexible by using CtxComponent
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 6396
diff changeset
   109
            w(u'<span id="appliName"><a href="%s">%s</a></span>' % (
de95bbed8781 [components] refactor main template header: make it much more flexible by using CtxComponent
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 6396
diff changeset
   110
                self._cw.base_url(), xml_escape(title)))
de95bbed8781 [components] refactor main template header: make it much more flexible by using CtxComponent
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 6396
diff changeset
   111
de95bbed8781 [components] refactor main template header: make it much more flexible by using CtxComponent
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 6396
diff changeset
   112
de95bbed8781 [components] refactor main template header: make it much more flexible by using CtxComponent
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 6396
diff changeset
   113
class CookieLoginComponent(HeaderComponent):
de95bbed8781 [components] refactor main template header: make it much more flexible by using CtxComponent
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 6396
diff changeset
   114
    __regid__ = 'anonuserlink'
de95bbed8781 [components] refactor main template header: make it much more flexible by using CtxComponent
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 6396
diff changeset
   115
    __select__ = (HeaderComponent.__select__ & anonymous_user()
6396
a9e4c51fc1c1 [login ui] cleanup and somewhat bw compat
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 6389
diff changeset
   116
                  & configuration_values('auth-mode', 'cookie'))
6428
de95bbed8781 [components] refactor main template header: make it much more flexible by using CtxComponent
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 6396
diff changeset
   117
    context = 'header-right'
6389
72ba82a26e05 refactor login box & form to enable easy pluggability
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents: 6141
diff changeset
   118
    loginboxid = 'popupLoginBox'
10119
3d7e500a0202 [views] use icons for user menu and login (header) (closes #3803684)
David Douard <david.douard@logilab.fr>
parents: 10080
diff changeset
   119
    _html = u"""<a class="logout icon-login" title="%s" href="javascript:
3d7e500a0202 [views] use icons for user menu and login (header) (closes #3803684)
David Douard <david.douard@logilab.fr>
parents: 10080
diff changeset
   120
cw.htmlhelpers.popupLoginBox('%s', '__login');">%s</a>"""
6428
de95bbed8781 [components] refactor main template header: make it much more flexible by using CtxComponent
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 6396
diff changeset
   121
de95bbed8781 [components] refactor main template header: make it much more flexible by using CtxComponent
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 6396
diff changeset
   122
    def render(self, w):
de95bbed8781 [components] refactor main template header: make it much more flexible by using CtxComponent
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 6396
diff changeset
   123
        # XXX bw compat, though should warn about subclasses redefining call
de95bbed8781 [components] refactor main template header: make it much more flexible by using CtxComponent
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 6396
diff changeset
   124
        self.w = w
de95bbed8781 [components] refactor main template header: make it much more flexible by using CtxComponent
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 6396
diff changeset
   125
        self.call()
6389
72ba82a26e05 refactor login box & form to enable easy pluggability
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents: 6141
diff changeset
   126
0
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   127
    def call(self):
10119
3d7e500a0202 [views] use icons for user menu and login (header) (closes #3803684)
David Douard <david.douard@logilab.fr>
parents: 10080
diff changeset
   128
        self._cw.add_css('cubicweb.pictograms.css')
6428
de95bbed8781 [components] refactor main template header: make it much more flexible by using CtxComponent
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 6396
diff changeset
   129
        self.w(self._html % (self._cw._('login / password'),
de95bbed8781 [components] refactor main template header: make it much more flexible by using CtxComponent
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 6396
diff changeset
   130
                             self.loginboxid, self._cw._('i18n_login_popup')))
6474
745b20ac1a68 [components] remove old deprecation warning
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 6462
diff changeset
   131
        self._cw.view('logform', rset=self.cw_rset, id=self.loginboxid,
745b20ac1a68 [components] remove old deprecation warning
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 6462
diff changeset
   132
                      klass='%s hidden' % self.loginboxid, title=False,
745b20ac1a68 [components] remove old deprecation warning
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 6462
diff changeset
   133
                      showmessage=False, w=self.w)
0
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   134
6396
a9e4c51fc1c1 [login ui] cleanup and somewhat bw compat
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 6389
diff changeset
   135
6428
de95bbed8781 [components] refactor main template header: make it much more flexible by using CtxComponent
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 6396
diff changeset
   136
class HTTPLoginComponent(CookieLoginComponent):
de95bbed8781 [components] refactor main template header: make it much more flexible by using CtxComponent
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 6396
diff changeset
   137
    __select__ = (HeaderComponent.__select__ & anonymous_user()
6396
a9e4c51fc1c1 [login ui] cleanup and somewhat bw compat
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 6389
diff changeset
   138
                  & configuration_values('auth-mode', 'http'))
6389
72ba82a26e05 refactor login box & form to enable easy pluggability
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents: 6141
diff changeset
   139
6428
de95bbed8781 [components] refactor main template header: make it much more flexible by using CtxComponent
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 6396
diff changeset
   140
    def render(self, w):
6389
72ba82a26e05 refactor login box & form to enable easy pluggability
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents: 6141
diff changeset
   141
        # this redirects to the 'login' controller which in turn
72ba82a26e05 refactor login box & form to enable easy pluggability
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents: 6141
diff changeset
   142
        # will raise a 401/Unauthorized
6428
de95bbed8781 [components] refactor main template header: make it much more flexible by using CtxComponent
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 6396
diff changeset
   143
        req = self._cw
de95bbed8781 [components] refactor main template header: make it much more flexible by using CtxComponent
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 6396
diff changeset
   144
        w(u'[<a class="logout" title="%s" href="%s">%s</a>]'
de95bbed8781 [components] refactor main template header: make it much more flexible by using CtxComponent
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 6396
diff changeset
   145
          % (req._('login / password'), req.build_url('login'), req._('login')))
de95bbed8781 [components] refactor main template header: make it much more flexible by using CtxComponent
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 6396
diff changeset
   146
de95bbed8781 [components] refactor main template header: make it much more flexible by using CtxComponent
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 6396
diff changeset
   147
de95bbed8781 [components] refactor main template header: make it much more flexible by using CtxComponent
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 6396
diff changeset
   148
_UserLink = class_renamed('_UserLink', HeaderComponent)
de95bbed8781 [components] refactor main template header: make it much more flexible by using CtxComponent
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 6396
diff changeset
   149
AnonUserLink = class_renamed('AnonUserLink', CookieLoginComponent)
de95bbed8781 [components] refactor main template header: make it much more flexible by using CtxComponent
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 6396
diff changeset
   150
AnonUserLink.__abstract__ = True
de95bbed8781 [components] refactor main template header: make it much more flexible by using CtxComponent
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 6396
diff changeset
   151
AnonUserLink.__select__ &= yes(1)
de95bbed8781 [components] refactor main template header: make it much more flexible by using CtxComponent
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 6396
diff changeset
   152
0
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   153
6428
de95bbed8781 [components] refactor main template header: make it much more flexible by using CtxComponent
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 6396
diff changeset
   154
class AnonUserStatusLink(HeaderComponent):
de95bbed8781 [components] refactor main template header: make it much more flexible by using CtxComponent
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 6396
diff changeset
   155
    __regid__ = 'userstatus'
7428
5338d895b891 [web session] fix session handling so we get a chance to have for instance the 'forgotpwd' feature working on a site where anonymous are not allowed
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 7101
diff changeset
   156
    __select__ = anonymous_user()
6428
de95bbed8781 [components] refactor main template header: make it much more flexible by using CtxComponent
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 6396
diff changeset
   157
    context = _('header-right')
de95bbed8781 [components] refactor main template header: make it much more flexible by using CtxComponent
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 6396
diff changeset
   158
    order = HeaderComponent.order - 10
5148
ec0ea7366066 [web components] refactor as book recommends :$
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 4935
diff changeset
   159
6428
de95bbed8781 [components] refactor main template header: make it much more flexible by using CtxComponent
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 6396
diff changeset
   160
    def render(self, w):
10119
3d7e500a0202 [views] use icons for user menu and login (header) (closes #3803684)
David Douard <david.douard@logilab.fr>
parents: 10080
diff changeset
   161
        pass
6428
de95bbed8781 [components] refactor main template header: make it much more flexible by using CtxComponent
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 6396
diff changeset
   162
de95bbed8781 [components] refactor main template header: make it much more flexible by using CtxComponent
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 6396
diff changeset
   163
class AuthenticatedUserStatus(AnonUserStatusLink):
7428
5338d895b891 [web session] fix session handling so we get a chance to have for instance the 'forgotpwd' feature working on a site where anonymous are not allowed
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 7101
diff changeset
   164
    __select__ = authenticated_user()
6428
de95bbed8781 [components] refactor main template header: make it much more flexible by using CtxComponent
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 6396
diff changeset
   165
de95bbed8781 [components] refactor main template header: make it much more flexible by using CtxComponent
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 6396
diff changeset
   166
    def render(self, w):
5148
ec0ea7366066 [web components] refactor as book recommends :$
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 4935
diff changeset
   167
        # display useractions and siteactions
10119
3d7e500a0202 [views] use icons for user menu and login (header) (closes #3803684)
David Douard <david.douard@logilab.fr>
parents: 10080
diff changeset
   168
        self._cw.add_css('cubicweb.pictograms.css')
11874
ea1d92b677b5 [views/optimization] Ensure we call rset.possible_actions with the same argument
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 11767
diff changeset
   169
        actions = self._cw.vreg['actions'].possible_actions(self._cw, rset=self.cw_rset,
ea1d92b677b5 [views/optimization] Ensure we call rset.possible_actions with the same argument
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 11767
diff changeset
   170
                                                            view=self.cw_extra_kwargs['view'])
5148
ec0ea7366066 [web components] refactor as book recommends :$
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 4935
diff changeset
   171
        box = MenuWidget('', 'userActionsBox', _class='', islist=False)
10119
3d7e500a0202 [views] use icons for user menu and login (header) (closes #3803684)
David Douard <david.douard@logilab.fr>
parents: 10080
diff changeset
   172
        menu = PopupBoxMenu(self._cw.user.login, isitem=False, link_class='icon-user')
5148
ec0ea7366066 [web components] refactor as book recommends :$
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 4935
diff changeset
   173
        box.append(menu)
ec0ea7366066 [web components] refactor as book recommends :$
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 4935
diff changeset
   174
        for action in actions.get('useractions', ()):
6800
3f3d576b87d9 [web action] refactor box menu handling, fixing #1401943 on the way
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 6678
diff changeset
   175
            menu.append(self.action_link(action))
5148
ec0ea7366066 [web components] refactor as book recommends :$
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 4935
diff changeset
   176
        if actions.get('useractions') and actions.get('siteactions'):
6800
3f3d576b87d9 [web action] refactor box menu handling, fixing #1401943 on the way
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 6678
diff changeset
   177
            menu.append(self.separator())
5148
ec0ea7366066 [web components] refactor as book recommends :$
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 4935
diff changeset
   178
        for action in actions.get('siteactions', ()):
6800
3f3d576b87d9 [web action] refactor box menu handling, fixing #1401943 on the way
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 6678
diff changeset
   179
            menu.append(self.action_link(action))
6428
de95bbed8781 [components] refactor main template header: make it much more flexible by using CtxComponent
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 6396
diff changeset
   180
        box.render(w=w)
5148
ec0ea7366066 [web components] refactor as book recommends :$
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 4935
diff changeset
   181
ec0ea7366066 [web components] refactor as book recommends :$
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 4935
diff changeset
   182
1554
3a3263df6cdd new primary view using uicfg.rdisplay (major api cleanup)
sylvain.thenault@logilab.fr
parents: 1514
diff changeset
   183
class ApplicationMessage(component.Component):
10080
bc7c3b0f439b [web] stop accepting the magic __message form parameter
Julien Cristau <julien.cristau@logilab.fr>
parents: 9760
diff changeset
   184
    """display messages given using the __message/_cwmsgid parameter into a
bc7c3b0f439b [web] stop accepting the magic __message form parameter
Julien Cristau <julien.cristau@logilab.fr>
parents: 9760
diff changeset
   185
    special div section
0
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   186
    """
7430
ef5165fa99e0 [ui messages] make application message component works when request has no cnx set and support for explicit message given through render argument
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 7428
diff changeset
   187
    __select__ = yes()
3377
dd9d292b6a6d use __regid__ instead of id on appobject classes
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 3185
diff changeset
   188
    __regid__ = 'applmessages'
9445
65d93a4fd11c [multi-sources-removal] Drop pyrorql and zmqrql sources
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 8694
diff changeset
   189
    # don't want user to hide this component using a cwproperty
2799
b703639614e7 refactor property handling to avoid name conflicts
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 2650
diff changeset
   190
    cw_property_defs = {}
0
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   191
7430
ef5165fa99e0 [ui messages] make application message component works when request has no cnx set and support for explicit message given through render argument
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 7428
diff changeset
   192
    def call(self, msg=None):
ef5165fa99e0 [ui messages] make application message component works when request has no cnx set and support for explicit message given through render argument
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 7428
diff changeset
   193
        if msg is None:
9445
65d93a4fd11c [multi-sources-removal] Drop pyrorql and zmqrql sources
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 8694
diff changeset
   194
            msg = self._cw.message # XXX don't call self._cw.message twice
0
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   195
        self.w(u'<div id="appMsg" onclick="%s" class="%s">\n' %
9445
65d93a4fd11c [multi-sources-removal] Drop pyrorql and zmqrql sources
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 8694
diff changeset
   196
               (toggle_action('appMsg'), (msg and ' ' or 'hidden')))
65d93a4fd11c [multi-sources-removal] Drop pyrorql and zmqrql sources
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 8694
diff changeset
   197
        self.w(u'<div class="message" id="%s">%s</div>' % (self.domid, msg))
0
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   198
        self.w(u'</div>')
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   199
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   200
6141
b8287e54b528 [web api] unify 'contentnav' (VComponent) and 'boxes' registries as 'ctxcomponents' (CtxComponent)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 6140
diff changeset
   201
# contextual components ########################################################
3840
2eff4348b1e4 prepare support for a 'context toolbar', used in tracker but will much probably be backported in default primary view. Turn pdfview component into a toolbar element
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 3818
diff changeset
   202
6141
b8287e54b528 [web api] unify 'contentnav' (VComponent) and 'boxes' registries as 'ctxcomponents' (CtxComponent)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 6140
diff changeset
   203
b8287e54b528 [web api] unify 'contentnav' (VComponent) and 'boxes' registries as 'ctxcomponents' (CtxComponent)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 6140
diff changeset
   204
class MetaDataComponent(component.EntityCtxComponent):
4004
c52619c738a5 api renaming update
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents: 3890
diff changeset
   205
    __regid__ = 'metadata'
3844
c2625c512085 stop calling render_entity_metadata in primary view, provides a
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 3840
diff changeset
   206
    context = 'navbottom'
c2625c512085 stop calling render_entity_metadata in primary view, provides a
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 3840
diff changeset
   207
    order = 1
c2625c512085 stop calling render_entity_metadata in primary view, provides a
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 3840
diff changeset
   208
6141
b8287e54b528 [web api] unify 'contentnav' (VComponent) and 'boxes' registries as 'ctxcomponents' (CtxComponent)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 6140
diff changeset
   209
    def render_body(self, w):
b8287e54b528 [web api] unify 'contentnav' (VComponent) and 'boxes' registries as 'ctxcomponents' (CtxComponent)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 6140
diff changeset
   210
        self.entity.view('metadata', w=w)
3844
c2625c512085 stop calling render_entity_metadata in primary view, provides a
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 3840
diff changeset
   211
3848
adc706f312a2 cleanup
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 3844
diff changeset
   212
6141
b8287e54b528 [web api] unify 'contentnav' (VComponent) and 'boxes' registries as 'ctxcomponents' (CtxComponent)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 6140
diff changeset
   213
class SectionLayout(component.Layout):
b8287e54b528 [web api] unify 'contentnav' (VComponent) and 'boxes' registries as 'ctxcomponents' (CtxComponent)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 6140
diff changeset
   214
    __select__ = match_context('navtop', 'navbottom',
b8287e54b528 [web api] unify 'contentnav' (VComponent) and 'boxes' registries as 'ctxcomponents' (CtxComponent)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 6140
diff changeset
   215
                               'navcontenttop', 'navcontentbottom')
b8287e54b528 [web api] unify 'contentnav' (VComponent) and 'boxes' registries as 'ctxcomponents' (CtxComponent)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 6140
diff changeset
   216
    cssclass = 'section'
b8287e54b528 [web api] unify 'contentnav' (VComponent) and 'boxes' registries as 'ctxcomponents' (CtxComponent)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 6140
diff changeset
   217
b8287e54b528 [web api] unify 'contentnav' (VComponent) and 'boxes' registries as 'ctxcomponents' (CtxComponent)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 6140
diff changeset
   218
    def render(self, w):
b8287e54b528 [web api] unify 'contentnav' (VComponent) and 'boxes' registries as 'ctxcomponents' (CtxComponent)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 6140
diff changeset
   219
        if self.init_rendering():
b8287e54b528 [web api] unify 'contentnav' (VComponent) and 'boxes' registries as 'ctxcomponents' (CtxComponent)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 6140
diff changeset
   220
            view = self.cw_extra_kwargs['view']
b8287e54b528 [web api] unify 'contentnav' (VComponent) and 'boxes' registries as 'ctxcomponents' (CtxComponent)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 6140
diff changeset
   221
            w(u'<div class="%s %s" id="%s">' % (self.cssclass, view.cssclass,
b8287e54b528 [web api] unify 'contentnav' (VComponent) and 'boxes' registries as 'ctxcomponents' (CtxComponent)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 6140
diff changeset
   222
                                                view.domid))
b8287e54b528 [web api] unify 'contentnav' (VComponent) and 'boxes' registries as 'ctxcomponents' (CtxComponent)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 6140
diff changeset
   223
            with wrap_on_write(w, '<h4>') as wow:
b8287e54b528 [web api] unify 'contentnav' (VComponent) and 'boxes' registries as 'ctxcomponents' (CtxComponent)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 6140
diff changeset
   224
                view.render_title(wow)
b8287e54b528 [web api] unify 'contentnav' (VComponent) and 'boxes' registries as 'ctxcomponents' (CtxComponent)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 6140
diff changeset
   225
            view.render_body(w)
b8287e54b528 [web api] unify 'contentnav' (VComponent) and 'boxes' registries as 'ctxcomponents' (CtxComponent)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 6140
diff changeset
   226
            w(u'</div>\n')