author | Sylvain Thénault <sylvain.thenault@logilab.fr> |
Fri, 24 Jul 2009 12:10:54 +0200 | |
changeset 2470 | 569d6641f08c |
parent 2381 | caad2367d940 |
child 2555 | ca7b122f34fa |
permissions | -rw-r--r-- |
0 | 1 |
# -*- coding: utf-8 -*- |
2 |
"""default templates for CubicWeb web client |
|
3 |
||
4 |
:organization: Logilab |
|
1977
606923dff11b
big bunch of copyright / docstring update
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
1851
diff
changeset
|
5 |
:copyright: 2001-2009 LOGILAB S.A. (Paris, FRANCE), license is LGPL v2. |
0 | 6 |
:contact: http://www.logilab.fr/ -- mailto:contact@logilab.fr |
1977
606923dff11b
big bunch of copyright / docstring update
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
1851
diff
changeset
|
7 |
:license: GNU Lesser General Public License, v2.1 - http://www.gnu.org/licenses |
0 | 8 |
""" |
9 |
__docformat__ = "restructuredtext en" |
|
10 |
||
2312
af4d8f75c5db
use xml_escape
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
2119
diff
changeset
|
11 |
from logilab.mtconverter import xml_escape |
0 | 12 |
|
823
cb8ccbef8fa5
main template refactoring
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
822
diff
changeset
|
13 |
from cubicweb.vregistry import objectify_selector |
822 | 14 |
from cubicweb.selectors import match_kwargs |
2061
6a5044f15cb9
[basetemplates] do not use STRICT_DOCTYPE directly, use self.doctype to deal with non xhtml browser
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
1977
diff
changeset
|
15 |
from cubicweb.view import View, MainTemplate, NOINDEX, NOFOLLOW |
811 | 16 |
from cubicweb.utils import make_uid, UStringIO |
0 | 17 |
|
18 |
# main templates ############################################################## |
|
19 |
||
641
ed668804af37
split main template into main template + page-content template
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
609
diff
changeset
|
20 |
class LogInOutTemplate(MainTemplate): |
0 | 21 |
|
22 |
def call(self): |
|
23 |
self.set_request_content_type() |
|
24 |
w = self.w |
|
25 |
self.write_doctype() |
|
26 |
self.template_header('text/html', self.req._('login_action')) |
|
27 |
w(u'<body>\n') |
|
28 |
self.content(w) |
|
29 |
w(u'</body>') |
|
30 |
||
31 |
def template_header(self, content_type, view=None, page_title='', additional_headers=()): |
|
32 |
w = self.whead |
|
33 |
# explictly close the <base> tag to avoid IE 6 bugs while browsing DOM |
|
2312
af4d8f75c5db
use xml_escape
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
2119
diff
changeset
|
34 |
w(u'<base href="%s"></base>' % xml_escape(self.req.base_url())) |
0 | 35 |
w(u'<meta http-equiv="content-type" content="%s; charset=%s"/>\n' |
36 |
% (content_type, self.req.encoding)) |
|
37 |
w(NOINDEX) |
|
38 |
w(NOFOLLOW) |
|
39 |
w(u'\n'.join(additional_headers) + u'\n') |
|
819 | 40 |
self.wview('htmlheader', rset=self.rset) |
2312
af4d8f75c5db
use xml_escape
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
2119
diff
changeset
|
41 |
w(u'<title>%s</title>\n' % xml_escape(page_title)) |
641
ed668804af37
split main template into main template + page-content template
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
609
diff
changeset
|
42 |
|
0 | 43 |
|
44 |
class LogInTemplate(LogInOutTemplate): |
|
45 |
id = 'login' |
|
46 |
title = 'log in' |
|
47 |
||
48 |
def content(self, w): |
|
819 | 49 |
self.wview('logform', rset=self.rset, id='loginBox', klass='') |
641
ed668804af37
split main template into main template + page-content template
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
609
diff
changeset
|
50 |
|
0 | 51 |
|
52 |
class LoggedOutTemplate(LogInOutTemplate): |
|
53 |
id = 'loggedout' |
|
54 |
title = 'logged out' |
|
55 |
||
56 |
def content(self, w): |
|
852
105893288777
simplify css style
Julien Jehannet <julien.jehannet@logilab.fr>
parents:
432
diff
changeset
|
57 |
# FIXME Deprecated code ? |
0 | 58 |
msg = self.req._('you have been logged out') |
852
105893288777
simplify css style
Julien Jehannet <julien.jehannet@logilab.fr>
parents:
432
diff
changeset
|
59 |
w(u'<h2>%s</h2>\n' % msg) |
0 | 60 |
if self.config['anonymous-user']: |
61 |
indexurl = self.build_url('view', vid='index', __message=msg) |
|
62 |
w(u'<p><a href="%s">%s</a><p>' % ( |
|
2312
af4d8f75c5db
use xml_escape
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
2119
diff
changeset
|
63 |
xml_escape(indexurl), |
0 | 64 |
self.req._('go back to the index page'))) |
65 |
||
823
cb8ccbef8fa5
main template refactoring
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
822
diff
changeset
|
66 |
@objectify_selector |
cb8ccbef8fa5
main template refactoring
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
822
diff
changeset
|
67 |
def templatable_view(cls, req, rset, *args, **kwargs): |
cb8ccbef8fa5
main template refactoring
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
822
diff
changeset
|
68 |
view = kwargs.pop('view', None) |
cb8ccbef8fa5
main template refactoring
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
822
diff
changeset
|
69 |
if view is None: |
cb8ccbef8fa5
main template refactoring
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
822
diff
changeset
|
70 |
return 1 |
cb8ccbef8fa5
main template refactoring
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
822
diff
changeset
|
71 |
if view.binary: |
cb8ccbef8fa5
main template refactoring
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
822
diff
changeset
|
72 |
return 0 |
cb8ccbef8fa5
main template refactoring
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
822
diff
changeset
|
73 |
if req.form.has_key('__notemplate'): |
cb8ccbef8fa5
main template refactoring
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
822
diff
changeset
|
74 |
return 0 |
cb8ccbef8fa5
main template refactoring
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
822
diff
changeset
|
75 |
return view.templatable |
cb8ccbef8fa5
main template refactoring
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
822
diff
changeset
|
76 |
|
cb8ccbef8fa5
main template refactoring
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
822
diff
changeset
|
77 |
|
cb8ccbef8fa5
main template refactoring
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
822
diff
changeset
|
78 |
class NonTemplatableViewTemplate(MainTemplate): |
cb8ccbef8fa5
main template refactoring
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
822
diff
changeset
|
79 |
"""main template for any non templatable views (xml, binaries, etc.)""" |
cb8ccbef8fa5
main template refactoring
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
822
diff
changeset
|
80 |
id = 'main-template' |
1421
77ee26df178f
doc type handling refactoring: do the ext substitution at the module level
sylvain.thenault@logilab.fr
parents:
1149
diff
changeset
|
81 |
__select__ = ~templatable_view() |
77ee26df178f
doc type handling refactoring: do the ext substitution at the module level
sylvain.thenault@logilab.fr
parents:
1149
diff
changeset
|
82 |
|
823
cb8ccbef8fa5
main template refactoring
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
822
diff
changeset
|
83 |
def call(self, view): |
cb8ccbef8fa5
main template refactoring
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
822
diff
changeset
|
84 |
view.set_request_content_type() |
1421
77ee26df178f
doc type handling refactoring: do the ext substitution at the module level
sylvain.thenault@logilab.fr
parents:
1149
diff
changeset
|
85 |
view.set_stream() |
77ee26df178f
doc type handling refactoring: do the ext substitution at the module level
sylvain.thenault@logilab.fr
parents:
1149
diff
changeset
|
86 |
xhtml_wrap = (self.req.form.has_key('__notemplate') and view.templatable |
77ee26df178f
doc type handling refactoring: do the ext substitution at the module level
sylvain.thenault@logilab.fr
parents:
1149
diff
changeset
|
87 |
and view.content_type == self.req.html_content_type()) |
77ee26df178f
doc type handling refactoring: do the ext substitution at the module level
sylvain.thenault@logilab.fr
parents:
1149
diff
changeset
|
88 |
if xhtml_wrap: |
2061
6a5044f15cb9
[basetemplates] do not use STRICT_DOCTYPE directly, use self.doctype to deal with non xhtml browser
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
1977
diff
changeset
|
89 |
view.w(u'<?xml version="1.0"?>\n' + self.doctype) |
1421
77ee26df178f
doc type handling refactoring: do the ext substitution at the module level
sylvain.thenault@logilab.fr
parents:
1149
diff
changeset
|
90 |
view.w(u'<div xmlns="http://www.w3.org/1999/xhtml" xmlns:cubicweb="http://www.logilab.org/2008/cubicweb">') |
823
cb8ccbef8fa5
main template refactoring
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
822
diff
changeset
|
91 |
# have to replace our unicode stream using view's binary stream |
1723 | 92 |
view.render() |
1421
77ee26df178f
doc type handling refactoring: do the ext substitution at the module level
sylvain.thenault@logilab.fr
parents:
1149
diff
changeset
|
93 |
if xhtml_wrap: |
77ee26df178f
doc type handling refactoring: do the ext substitution at the module level
sylvain.thenault@logilab.fr
parents:
1149
diff
changeset
|
94 |
view.w(u'</div>') |
823
cb8ccbef8fa5
main template refactoring
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
822
diff
changeset
|
95 |
self._stream = view._stream |
cb8ccbef8fa5
main template refactoring
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
822
diff
changeset
|
96 |
|
641
ed668804af37
split main template into main template + page-content template
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
609
diff
changeset
|
97 |
|
0 | 98 |
class TheMainTemplate(MainTemplate): |
99 |
"""default main template : |
|
641
ed668804af37
split main template into main template + page-content template
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
609
diff
changeset
|
100 |
|
0 | 101 |
- call header / footer templates |
102 |
""" |
|
823
cb8ccbef8fa5
main template refactoring
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
822
diff
changeset
|
103 |
id = 'main-template' |
cb8ccbef8fa5
main template refactoring
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
822
diff
changeset
|
104 |
__select__ = templatable_view() |
1421
77ee26df178f
doc type handling refactoring: do the ext substitution at the module level
sylvain.thenault@logilab.fr
parents:
1149
diff
changeset
|
105 |
|
823
cb8ccbef8fa5
main template refactoring
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
822
diff
changeset
|
106 |
def call(self, view): |
cb8ccbef8fa5
main template refactoring
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
822
diff
changeset
|
107 |
self.set_request_content_type() |
cb8ccbef8fa5
main template refactoring
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
822
diff
changeset
|
108 |
self.template_header(self.content_type, view) |
cb8ccbef8fa5
main template refactoring
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
822
diff
changeset
|
109 |
w = self.w |
cb8ccbef8fa5
main template refactoring
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
822
diff
changeset
|
110 |
w(u'<div id="pageContent">\n') |
cb8ccbef8fa5
main template refactoring
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
822
diff
changeset
|
111 |
vtitle = self.req.form.get('vtitle') |
cb8ccbef8fa5
main template refactoring
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
822
diff
changeset
|
112 |
if vtitle: |
2312
af4d8f75c5db
use xml_escape
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
2119
diff
changeset
|
113 |
w(u'<h1 class="vtitle">%s</h1>\n' % xml_escape(vtitle)) |
823
cb8ccbef8fa5
main template refactoring
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
822
diff
changeset
|
114 |
# display entity type restriction component |
2058
7ef12c03447c
nicer vreg api, try to make rset an optional named argument in select and derivated (including selectors)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
1977
diff
changeset
|
115 |
etypefilter = self.vreg.select_vobject('components', 'etypenavigation', |
7ef12c03447c
nicer vreg api, try to make rset an optional named argument in select and derivated (including selectors)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
1977
diff
changeset
|
116 |
self.req, rset=self.rset) |
7ef12c03447c
nicer vreg api, try to make rset an optional named argument in select and derivated (including selectors)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
1977
diff
changeset
|
117 |
if etypefilter: |
1723 | 118 |
etypefilter.render(w=w) |
823
cb8ccbef8fa5
main template refactoring
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
822
diff
changeset
|
119 |
self.nav_html = UStringIO() |
872 | 120 |
if view and view.need_navigation: |
121 |
view.paginate(w=self.nav_html.write) |
|
823
cb8ccbef8fa5
main template refactoring
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
822
diff
changeset
|
122 |
w(_(self.nav_html.getvalue())) |
cb8ccbef8fa5
main template refactoring
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
822
diff
changeset
|
123 |
w(u'<div id="contentmain">\n') |
1723 | 124 |
view.render(w=w) |
823
cb8ccbef8fa5
main template refactoring
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
822
diff
changeset
|
125 |
w(u'</div>\n') # close id=contentmain |
cb8ccbef8fa5
main template refactoring
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
822
diff
changeset
|
126 |
w(_(self.nav_html.getvalue())) |
cb8ccbef8fa5
main template refactoring
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
822
diff
changeset
|
127 |
w(u'</div>\n') # closes id=pageContent |
cb8ccbef8fa5
main template refactoring
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
822
diff
changeset
|
128 |
self.template_footer(view) |
0 | 129 |
|
130 |
def template_header(self, content_type, view=None, page_title='', additional_headers=()): |
|
131 |
page_title = page_title or view.page_title() |
|
132 |
additional_headers = additional_headers or view.html_headers() |
|
133 |
self.template_html_header(content_type, page_title, additional_headers) |
|
134 |
self.template_body_header(view) |
|
641
ed668804af37
split main template into main template + page-content template
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
609
diff
changeset
|
135 |
|
0 | 136 |
def template_html_header(self, content_type, page_title, additional_headers=()): |
137 |
w = self.whead |
|
138 |
lang = self.req.lang |
|
139 |
self.write_doctype() |
|
2312
af4d8f75c5db
use xml_escape
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
2119
diff
changeset
|
140 |
w(u'<base href="%s" />' % xml_escape(self.req.base_url())) |
0 | 141 |
w(u'<meta http-equiv="content-type" content="%s; charset=%s"/>\n' |
142 |
% (content_type, self.req.encoding)) |
|
143 |
w(u'\n'.join(additional_headers) + u'\n') |
|
819 | 144 |
self.wview('htmlheader', rset=self.rset) |
0 | 145 |
if page_title: |
2312
af4d8f75c5db
use xml_escape
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
2119
diff
changeset
|
146 |
w(u'<title>%s</title>\n' % xml_escape(page_title)) |
0 | 147 |
|
148 |
def template_body_header(self, view): |
|
149 |
w = self.w |
|
150 |
w(u'<body>\n') |
|
819 | 151 |
self.wview('header', rset=self.rset, view=view) |
0 | 152 |
w(u'<div id="page"><table width="100%" border="0" id="mainLayout"><tr>\n') |
153 |
self.nav_column(view, 'left') |
|
154 |
w(u'<td id="contentcol">\n') |
|
2058
7ef12c03447c
nicer vreg api, try to make rset an optional named argument in select and derivated (including selectors)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
1977
diff
changeset
|
155 |
rqlcomp = self.vreg.select_object('components', 'rqlinput', self.req, |
7ef12c03447c
nicer vreg api, try to make rset an optional named argument in select and derivated (including selectors)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
1977
diff
changeset
|
156 |
rset=self.rset) |
0 | 157 |
if rqlcomp: |
1723 | 158 |
rqlcomp.render(w=self.w, view=view) |
2058
7ef12c03447c
nicer vreg api, try to make rset an optional named argument in select and derivated (including selectors)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
1977
diff
changeset
|
159 |
msgcomp = self.vreg.select_object('components', 'applmessages', |
7ef12c03447c
nicer vreg api, try to make rset an optional named argument in select and derivated (including selectors)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
1977
diff
changeset
|
160 |
self.req, rset=self.rset) |
0 | 161 |
if msgcomp: |
1723 | 162 |
msgcomp.render(w=self.w) |
0 | 163 |
self.content_header(view) |
641
ed668804af37
split main template into main template + page-content template
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
609
diff
changeset
|
164 |
|
0 | 165 |
def template_footer(self, view=None): |
166 |
self.content_footer(view) |
|
167 |
self.w(u'</td>\n') |
|
168 |
self.nav_column(view, 'right') |
|
169 |
self.w(u'</tr></table></div>\n') |
|
819 | 170 |
self.wview('footer', rset=self.rset) |
0 | 171 |
self.w(u'</body>') |
172 |
||
173 |
def nav_column(self, view, context): |
|
2058
7ef12c03447c
nicer vreg api, try to make rset an optional named argument in select and derivated (including selectors)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
1977
diff
changeset
|
174 |
boxes = list(self.vreg.possible_vobjects('boxes', self.req, rset=self.rset, |
0 | 175 |
view=view, context=context)) |
176 |
if boxes: |
|
177 |
self.w(u'<td class="navcol"><div class="navboxes">\n') |
|
178 |
for box in boxes: |
|
1723 | 179 |
box.render(w=self.w, view=view) |
0 | 180 |
self.w(u'</div></td>\n') |
181 |
||
182 |
def content_header(self, view=None): |
|
183 |
"""by default, display informal messages in content header""" |
|
819 | 184 |
self.wview('contentheader', rset=self.rset, view=view) |
641
ed668804af37
split main template into main template + page-content template
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
609
diff
changeset
|
185 |
|
0 | 186 |
def content_footer(self, view=None): |
819 | 187 |
self.wview('contentfooter', rset=self.rset, view=view) |
0 | 188 |
|
189 |
||
190 |
class ErrorTemplate(TheMainTemplate): |
|
191 |
"""fallback template if an internal error occured during displaying the |
|
192 |
main template. This template may be called for authentication error, |
|
193 |
which means that req.cnx and req.user may not be set. |
|
194 |
""" |
|
832
8e06873d80d3
rename error template to avoid conflicts with the error view
sylvain.thenault@logilab.fr
parents:
828
diff
changeset
|
195 |
id = 'error-template' |
641
ed668804af37
split main template into main template + page-content template
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
609
diff
changeset
|
196 |
|
0 | 197 |
def call(self): |
198 |
"""display an unexpected error""" |
|
199 |
self.set_request_content_type() |
|
200 |
self.req.reset_headers() |
|
2058
7ef12c03447c
nicer vreg api, try to make rset an optional named argument in select and derivated (including selectors)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
1977
diff
changeset
|
201 |
view = self.vreg.select('views', 'error', self.req, rset=self.rset) |
0 | 202 |
self.template_header(self.content_type, view, self.req._('an error occured'), |
203 |
[NOINDEX, NOFOLLOW]) |
|
1723 | 204 |
view.render(w=self.w) |
0 | 205 |
self.template_footer(view) |
641
ed668804af37
split main template into main template + page-content template
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
609
diff
changeset
|
206 |
|
0 | 207 |
def template_header(self, content_type, view=None, page_title='', additional_headers=()): |
208 |
w = self.whead |
|
209 |
lang = self.req.lang |
|
210 |
self.write_doctype() |
|
211 |
w(u'<meta http-equiv="content-type" content="%s; charset=%s"/>\n' |
|
212 |
% (content_type, self.req.encoding)) |
|
213 |
w(u'\n'.join(additional_headers)) |
|
819 | 214 |
self.wview('htmlheader', rset=self.rset) |
2312
af4d8f75c5db
use xml_escape
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
2119
diff
changeset
|
215 |
w(u'<title>%s</title>\n' % xml_escape(page_title)) |
0 | 216 |
self.w(u'<body>\n') |
217 |
||
218 |
def template_footer(self, view=None): |
|
219 |
self.w(u'</body>') |
|
220 |
||
221 |
||
222 |
class SimpleMainTemplate(TheMainTemplate): |
|
223 |
||
224 |
id = 'main-no-top' |
|
641
ed668804af37
split main template into main template + page-content template
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
609
diff
changeset
|
225 |
|
163
451a3e35dbcb
repairing error from preceding commit
Laure Bourgois <Laure.Bourgois@logilab.fr>
parents:
158
diff
changeset
|
226 |
def template_header(self, content_type, view=None, page_title='', additional_headers=()): |
451a3e35dbcb
repairing error from preceding commit
Laure Bourgois <Laure.Bourgois@logilab.fr>
parents:
158
diff
changeset
|
227 |
page_title = page_title or view.page_title() |
0 | 228 |
additional_headers = additional_headers or view.html_headers() |
229 |
whead = self.whead |
|
230 |
lang = self.req.lang |
|
231 |
self.write_doctype() |
|
232 |
whead(u'<meta http-equiv="content-type" content="%s; charset=%s"/>\n' |
|
233 |
% (content_type, self.req.encoding)) |
|
234 |
whead(u'\n'.join(additional_headers) + u'\n') |
|
819 | 235 |
self.wview('htmlheader', rset=self.rset) |
0 | 236 |
w = self.w |
2312
af4d8f75c5db
use xml_escape
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
2119
diff
changeset
|
237 |
w(u'<title>%s</title>\n' % xml_escape(page_title)) |
0 | 238 |
w(u'<body>\n') |
239 |
w(u'<div id="page">') |
|
240 |
w(u'<table width="100%" height="100%" border="0"><tr>\n') |
|
241 |
w(u'<td class="navcol">\n') |
|
242 |
self.topleft_header() |
|
2058
7ef12c03447c
nicer vreg api, try to make rset an optional named argument in select and derivated (including selectors)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
1977
diff
changeset
|
243 |
boxes = list(self.vreg.possible_vobjects('boxes', self.req, rset=self.rset, |
0 | 244 |
view=view, context='left')) |
245 |
if boxes: |
|
246 |
w(u'<div class="navboxes">\n') |
|
247 |
for box in boxes: |
|
1723 | 248 |
box.render(w=w) |
0 | 249 |
self.w(u'</div>\n') |
250 |
w(u'</td>') |
|
251 |
w(u'<td id="contentcol" rowspan="2">') |
|
252 |
w(u'<div id="pageContent">\n') |
|
253 |
vtitle = self.req.form.get('vtitle') |
|
254 |
if vtitle: |
|
2312
af4d8f75c5db
use xml_escape
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
2119
diff
changeset
|
255 |
w(u'<h1 class="vtitle">%s</h1>' % xml_escape(vtitle)) |
641
ed668804af37
split main template into main template + page-content template
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
609
diff
changeset
|
256 |
|
0 | 257 |
def topleft_header(self): |
2058
7ef12c03447c
nicer vreg api, try to make rset an optional named argument in select and derivated (including selectors)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
1977
diff
changeset
|
258 |
logo = self.vreg.select_vobject('components', 'logo', self.req, |
7ef12c03447c
nicer vreg api, try to make rset an optional named argument in select and derivated (including selectors)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
1977
diff
changeset
|
259 |
rset=self.rset) |
7ef12c03447c
nicer vreg api, try to make rset an optional named argument in select and derivated (including selectors)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
1977
diff
changeset
|
260 |
if logo: |
7ef12c03447c
nicer vreg api, try to make rset an optional named argument in select and derivated (including selectors)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
1977
diff
changeset
|
261 |
self.w(u'<table id="header"><tr>\n') |
7ef12c03447c
nicer vreg api, try to make rset an optional named argument in select and derivated (including selectors)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
1977
diff
changeset
|
262 |
self.w(u'<td>') |
7ef12c03447c
nicer vreg api, try to make rset an optional named argument in select and derivated (including selectors)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
1977
diff
changeset
|
263 |
logo.render(w=self.w) |
7ef12c03447c
nicer vreg api, try to make rset an optional named argument in select and derivated (including selectors)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
1977
diff
changeset
|
264 |
self.w(u'</td>\n') |
7ef12c03447c
nicer vreg api, try to make rset an optional named argument in select and derivated (including selectors)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
1977
diff
changeset
|
265 |
self.w(u'</tr></table>\n') |
0 | 266 |
|
267 |
# page parts templates ######################################################## |
|
268 |
||
816
9cd49a910fce
kill Template class and 'templates' registry
sylvain.thenault@logilab.fr
parents:
811
diff
changeset
|
269 |
class HTMLHeader(View): |
0 | 270 |
"""default html headers""" |
271 |
id = 'htmlheader' |
|
641
ed668804af37
split main template into main template + page-content template
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
609
diff
changeset
|
272 |
|
0 | 273 |
def call(self, **kwargs): |
274 |
self.favicon() |
|
275 |
self.stylesheets() |
|
276 |
self.javascripts() |
|
277 |
self.alternates() |
|
278 |
self.pageid() |
|
279 |
||
280 |
def favicon(self): |
|
281 |
favicon = self.req.external_resource('FAVICON', None) |
|
282 |
if favicon: |
|
283 |
self.whead(u'<link rel="shortcut icon" href="%s"/>\n' % favicon) |
|
641
ed668804af37
split main template into main template + page-content template
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
609
diff
changeset
|
284 |
|
0 | 285 |
def stylesheets(self): |
286 |
req = self.req |
|
287 |
add_css = req.add_css |
|
288 |
for css in req.external_resource('STYLESHEETS'): |
|
289 |
add_css(css, localfile=False) |
|
290 |
for css in req.external_resource('STYLESHEETS_PRINT'): |
|
291 |
add_css(css, u'print', localfile=False) |
|
292 |
for css in req.external_resource('IE_STYLESHEETS'): |
|
293 |
add_css(css, localfile=False, ieonly=True) |
|
641
ed668804af37
split main template into main template + page-content template
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
609
diff
changeset
|
294 |
|
0 | 295 |
def javascripts(self): |
296 |
for jscript in self.req.external_resource('JAVASCRIPTS'): |
|
297 |
self.req.add_js(jscript, localfile=False) |
|
641
ed668804af37
split main template into main template + page-content template
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
609
diff
changeset
|
298 |
|
0 | 299 |
def alternates(self): |
2058
7ef12c03447c
nicer vreg api, try to make rset an optional named argument in select and derivated (including selectors)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
1977
diff
changeset
|
300 |
urlgetter = self.vreg.select_object('components', 'rss_feed_url', |
7ef12c03447c
nicer vreg api, try to make rset an optional named argument in select and derivated (including selectors)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
1977
diff
changeset
|
301 |
self.req, rset=self.rset) |
142
0425ee84cfa6
add selector to test if result set is an object (for rss feed component)
Laure Bourgois <Laure.Bourgois@logilab.fr>
parents:
29
diff
changeset
|
302 |
if urlgetter is not None: |
0 | 303 |
self.whead(u'<link rel="alternate" type="application/rss+xml" title="RSS feed" href="%s"/>\n' |
2381 | 304 |
% xml_escape(urlgetter.feed_url())) |
0 | 305 |
|
306 |
def pageid(self): |
|
307 |
req = self.req |
|
308 |
pid = make_uid(id(req)) |
|
309 |
req.pageid = pid |
|
1138
22f634977c95
make pylint happy, fix some bugs on the way
sylvain.thenault@logilab.fr
parents:
1132
diff
changeset
|
310 |
req.html_headers.define_var('pageid', pid) |
0 | 311 |
|
312 |
||
816
9cd49a910fce
kill Template class and 'templates' registry
sylvain.thenault@logilab.fr
parents:
811
diff
changeset
|
313 |
class HTMLPageHeader(View): |
0 | 314 |
"""default html page header""" |
315 |
id = 'header' |
|
641
ed668804af37
split main template into main template + page-content template
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
609
diff
changeset
|
316 |
|
0 | 317 |
def call(self, view, **kwargs): |
318 |
self.main_header(view) |
|
319 |
self.w(u''' |
|
320 |
<div id="stateheader">''') |
|
321 |
self.state_header() |
|
322 |
self.w(u''' |
|
323 |
</div> |
|
324 |
''') |
|
641
ed668804af37
split main template into main template + page-content template
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
609
diff
changeset
|
325 |
|
0 | 326 |
def main_header(self, view): |
327 |
"""build the top menu with authentification info and the rql box""" |
|
328 |
self.w(u'<table id="header"><tr>\n') |
|
329 |
self.w(u'<td id="firstcolumn">') |
|
2058
7ef12c03447c
nicer vreg api, try to make rset an optional named argument in select and derivated (including selectors)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
1977
diff
changeset
|
330 |
logo = self.vreg.select_vobject('components', 'logo', |
7ef12c03447c
nicer vreg api, try to make rset an optional named argument in select and derivated (including selectors)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
1977
diff
changeset
|
331 |
self.req, rset=self.rset) |
7ef12c03447c
nicer vreg api, try to make rset an optional named argument in select and derivated (including selectors)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
1977
diff
changeset
|
332 |
if logo: |
7ef12c03447c
nicer vreg api, try to make rset an optional named argument in select and derivated (including selectors)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
1977
diff
changeset
|
333 |
logo.render(w=self.w) |
0 | 334 |
self.w(u'</td>\n') |
335 |
# appliname and breadcrumbs |
|
336 |
self.w(u'<td id="headtext">') |
|
2058
7ef12c03447c
nicer vreg api, try to make rset an optional named argument in select and derivated (including selectors)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
1977
diff
changeset
|
337 |
for cid in ('appliname', 'breadcrumbs'): |
7ef12c03447c
nicer vreg api, try to make rset an optional named argument in select and derivated (including selectors)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
1977
diff
changeset
|
338 |
comp = self.vreg.select_vobject('components', cid, |
7ef12c03447c
nicer vreg api, try to make rset an optional named argument in select and derivated (including selectors)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
1977
diff
changeset
|
339 |
self.req, rset=self.rset) |
7ef12c03447c
nicer vreg api, try to make rset an optional named argument in select and derivated (including selectors)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
1977
diff
changeset
|
340 |
if comp: |
7ef12c03447c
nicer vreg api, try to make rset an optional named argument in select and derivated (including selectors)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
1977
diff
changeset
|
341 |
comp.render(w=self.w) |
0 | 342 |
self.w(u'</td>') |
343 |
# logged user and help |
|
344 |
self.w(u'<td>\n') |
|
2058
7ef12c03447c
nicer vreg api, try to make rset an optional named argument in select and derivated (including selectors)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
1977
diff
changeset
|
345 |
comp = self.vreg.select_vobject('components', 'loggeduserlink', |
7ef12c03447c
nicer vreg api, try to make rset an optional named argument in select and derivated (including selectors)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
1977
diff
changeset
|
346 |
self.req, rset=self.rset) |
7ef12c03447c
nicer vreg api, try to make rset an optional named argument in select and derivated (including selectors)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
1977
diff
changeset
|
347 |
if comp: |
7ef12c03447c
nicer vreg api, try to make rset an optional named argument in select and derivated (including selectors)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
1977
diff
changeset
|
348 |
comp.render(w=self.w) |
0 | 349 |
self.w(u'</td><td>') |
2058
7ef12c03447c
nicer vreg api, try to make rset an optional named argument in select and derivated (including selectors)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
1977
diff
changeset
|
350 |
helpcomp = self.vreg.select_vobject('components', 'help', |
7ef12c03447c
nicer vreg api, try to make rset an optional named argument in select and derivated (including selectors)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
1977
diff
changeset
|
351 |
self.req, rset=self.rset) |
7ef12c03447c
nicer vreg api, try to make rset an optional named argument in select and derivated (including selectors)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
1977
diff
changeset
|
352 |
if helpcomp: |
1723 | 353 |
helpcomp.render(w=self.w) |
0 | 354 |
self.w(u'</td>') |
355 |
# lastcolumn |
|
356 |
self.w(u'<td id="lastcolumn">') |
|
357 |
self.w(u'</td>\n') |
|
358 |
self.w(u'</tr></table>\n') |
|
819 | 359 |
self.wview('logform', rset=self.rset, id='popupLoginBox', klass='hidden', |
360 |
title=False, message=False) |
|
641
ed668804af37
split main template into main template + page-content template
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
609
diff
changeset
|
361 |
|
0 | 362 |
def state_header(self): |
363 |
state = self.req.search_state |
|
364 |
if state[0] == 'normal': |
|
365 |
return |
|
366 |
_ = self.req._ |
|
367 |
value = self.view('oneline', self.req.eid_rset(state[1][1])) |
|
368 |
msg = ' '.join((_("searching for"), |
|
369 |
display_name(self.req, state[1][3]), |
|
370 |
_("to associate with"), value, |
|
641
ed668804af37
split main template into main template + page-content template
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
609
diff
changeset
|
371 |
_("by relation"), '"', |
0 | 372 |
display_name(self.req, state[1][2], state[1][0]), |
373 |
'"')) |
|
374 |
return self.w(u'<div class="stateMessage">%s</div>' % msg) |
|
375 |
||
376 |
||
377 |
||
816
9cd49a910fce
kill Template class and 'templates' registry
sylvain.thenault@logilab.fr
parents:
811
diff
changeset
|
378 |
class HTMLPageFooter(View): |
0 | 379 |
"""default html page footer: include logo if any, and close the HTML body |
380 |
""" |
|
381 |
id = 'footer' |
|
641
ed668804af37
split main template into main template + page-content template
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
609
diff
changeset
|
382 |
|
0 | 383 |
def call(self, **kwargs): |
384 |
req = self.req |
|
385 |
self.w(u'<div class="footer">') |
|
386 |
# XXX Take object from the registry if in there? would be |
|
387 |
# better anyway |
|
388 |
from cubicweb.web.views.wdoc import ChangeLogView |
|
389 |
self.w(u'<a href="%s">%s</a> | ' % (req.build_url('changelog'), |
|
390 |
req._(ChangeLogView.title).lower())) |
|
391 |
self.w(u'<a href="%s">%s</a> | ' % (req.build_url('doc/about'), |
|
392 |
req._('about this site'))) |
|
580 | 393 |
self.w(u'© 2001-2009 <a href="http://www.logilab.fr">Logilab S.A.</a>') |
0 | 394 |
self.w(u'</div>') |
395 |
||
396 |
||
816
9cd49a910fce
kill Template class and 'templates' registry
sylvain.thenault@logilab.fr
parents:
811
diff
changeset
|
397 |
class HTMLContentHeader(View): |
0 | 398 |
"""default html page content header: |
399 |
* include message component if selectable for this request |
|
400 |
* include selectable content navigation components |
|
401 |
""" |
|
402 |
id = 'contentheader' |
|
641
ed668804af37
split main template into main template + page-content template
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
609
diff
changeset
|
403 |
|
0 | 404 |
def call(self, view, **kwargs): |
405 |
"""by default, display informal messages in content header""" |
|
406 |
components = self.vreg.possible_vobjects('contentnavigation', |
|
2058
7ef12c03447c
nicer vreg api, try to make rset an optional named argument in select and derivated (including selectors)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
1977
diff
changeset
|
407 |
self.req, rset=self.rset, |
0 | 408 |
view=view, context='navtop') |
409 |
if components: |
|
410 |
self.w(u'<div id="contentheader">') |
|
411 |
for comp in components: |
|
1723 | 412 |
comp.render(w=self.w, view=view) |
0 | 413 |
self.w(u'</div><div class="clear"></div>') |
414 |
||
415 |
||
816
9cd49a910fce
kill Template class and 'templates' registry
sylvain.thenault@logilab.fr
parents:
811
diff
changeset
|
416 |
class HTMLContentFooter(View): |
0 | 417 |
"""default html page content footer: include selectable content navigation |
418 |
components |
|
419 |
""" |
|
420 |
id = 'contentfooter' |
|
641
ed668804af37
split main template into main template + page-content template
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
609
diff
changeset
|
421 |
|
0 | 422 |
def call(self, view, **kwargs): |
423 |
components = self.vreg.possible_vobjects('contentnavigation', |
|
2058
7ef12c03447c
nicer vreg api, try to make rset an optional named argument in select and derivated (including selectors)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
1977
diff
changeset
|
424 |
self.req, rset=self.rset, |
0 | 425 |
view=view, context='navbottom') |
426 |
if components: |
|
427 |
self.w(u'<div id="contentfooter">') |
|
428 |
for comp in components: |
|
1723 | 429 |
comp.render(w=self.w, view=view) |
0 | 430 |
self.w(u'</div>') |
431 |
||
432 |
||
816
9cd49a910fce
kill Template class and 'templates' registry
sylvain.thenault@logilab.fr
parents:
811
diff
changeset
|
433 |
class LogFormTemplate(View): |
0 | 434 |
id = 'logform' |
826
51cb3d85c059
fix LogFormTemplate selector
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
823
diff
changeset
|
435 |
__select__ = match_kwargs('id', 'klass') |
1421
77ee26df178f
doc type handling refactoring: do the ext substitution at the module level
sylvain.thenault@logilab.fr
parents:
1149
diff
changeset
|
436 |
|
0 | 437 |
title = 'log in' |
1421
77ee26df178f
doc type handling refactoring: do the ext substitution at the module level
sylvain.thenault@logilab.fr
parents:
1149
diff
changeset
|
438 |
|
0 | 439 |
def call(self, id, klass, title=True, message=True): |
440 |
self.req.add_css('cubicweb.login.css') |
|
441 |
self.w(u'<div id="%s" class="%s">' % (id, klass)) |
|
442 |
if title: |
|
443 |
self.w(u'<div id="loginTitle">%s</div>' |
|
2119
dc1eedd06766
deal with empty site-title
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
2061
diff
changeset
|
444 |
% (self.req.property_value('ui.site-title') or u' ')) |
641
ed668804af37
split main template into main template + page-content template
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
609
diff
changeset
|
445 |
self.w(u'<div id="loginContent">\n') |
0 | 446 |
|
447 |
if message: |
|
448 |
self.display_message() |
|
449 |
if self.config['auth-mode'] == 'http': |
|
450 |
# HTTP authentication |
|
451 |
pass |
|
452 |
else: |
|
453 |
# Cookie authentication |
|
454 |
self.login_form(id) |
|
455 |
self.w(u'</div></div>\n') |
|
456 |
||
457 |
def display_message(self): |
|
458 |
message = self.req.message |
|
459 |
if message: |
|
460 |
self.w(u'<div class="simpleMessage">%s</div>\n' % message) |
|
641
ed668804af37
split main template into main template + page-content template
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
609
diff
changeset
|
461 |
|
0 | 462 |
def login_form(self, id): |
463 |
_ = self.req._ |
|
464 |
self.w(u'<form method="post" action="%s" id="login_form">\n' |
|
2312
af4d8f75c5db
use xml_escape
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
2119
diff
changeset
|
465 |
% xml_escape(login_form_url(self.config, self.req))) |
0 | 466 |
self.w(u'<table>\n') |
467 |
self.w(u'<tr>\n') |
|
1776
4be367276874
adapt login box message to allow-email-login configuration
Florent <florent@secondweb.fr>
parents:
1723
diff
changeset
|
468 |
msg = (self.config['allow-email-login'] and _('login or email')) or _('login') |
4be367276874
adapt login box message to allow-email-login configuration
Florent <florent@secondweb.fr>
parents:
1723
diff
changeset
|
469 |
self.w(u'<td><label for="__login">%s</label></td>' % msg) |
0 | 470 |
self.w(u'<td><input name="__login" id="__login" class="data" type="text" /></td>') |
471 |
self.w(u'</tr><tr>\n') |
|
472 |
self.w(u'<td><label for="__password" >%s</label></td>' % _('password')) |
|
473 |
self.w(u'<td><input name="__password" id="__password" class="data" type="password" /></td>\n') |
|
474 |
self.w(u'</tr><tr>\n') |
|
475 |
self.w(u'<td> </td><td><input type="submit" class="loginButton right" value="%s" />\n</td>' % _('log in')) |
|
476 |
self.w(u'</tr>\n') |
|
477 |
self.w(u'</table>\n') |
|
478 |
self.w(u'</form>\n') |
|
29
7d14f1eadded
fix focus problems on login inputs
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
16
diff
changeset
|
479 |
self.req.html_headers.add_onload('jQuery("#__login:visible").focus()') |
0 | 480 |
|
641
ed668804af37
split main template into main template + page-content template
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
609
diff
changeset
|
481 |
|
0 | 482 |
def login_form_url(config, req): |
483 |
if req.https: |
|
484 |
return req.url() |
|
485 |
if config.get('https-url'): |
|
486 |
return req.url().replace(req.base_url(), config['https-url']) |
|
487 |
return req.url() |
|
488 |
||
823
cb8ccbef8fa5
main template refactoring
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
822
diff
changeset
|
489 |
|
cb8ccbef8fa5
main template refactoring
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
822
diff
changeset
|
490 |
## vregistry registration callback ############################################ |
cb8ccbef8fa5
main template refactoring
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
822
diff
changeset
|
491 |
def registration_callback(vreg): |
cb8ccbef8fa5
main template refactoring
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
822
diff
changeset
|
492 |
vreg.register_all(globals().values(), modname=__name__) |