11 :copyright: 2001-2009 LOGILAB S.A. (Paris, FRANCE), all rights reserved. |
11 :copyright: 2001-2009 LOGILAB S.A. (Paris, FRANCE), all rights reserved. |
12 :contact: http://www.logilab.fr/ -- mailto:contact@logilab.fr |
12 :contact: http://www.logilab.fr/ -- mailto:contact@logilab.fr |
13 """ |
13 """ |
14 __docformat__ = "restructuredtext en" |
14 __docformat__ = "restructuredtext en" |
15 |
15 |
|
16 from warnings import warn |
16 from time import timezone |
17 from time import timezone |
17 |
18 |
18 from rql import nodes |
19 from rql import nodes |
19 |
20 |
20 from logilab.common.decorators import cached |
21 from logilab.common.decorators import cached |
141 self.w(u'<tr>') |
142 self.w(u'<tr>') |
142 self.w(u'<td valign="top">') |
143 self.w(u'<td valign="top">') |
143 self.w(u'<div class="mainInfo">') |
144 self.w(u'<div class="mainInfo">') |
144 self.render_entity_attributes(entity, siderelations) |
145 self.render_entity_attributes(entity, siderelations) |
145 self.w(u'</div>') |
146 self.w(u'</div>') |
146 self.w(u'<div class="navcontenttop">') |
147 self.content_navigation_components('navcontenttop') |
147 for comp in self.vreg.possible_vobjects('contentnavigation', |
|
148 self.req, self.rset, |
|
149 view=self, context='navcontenttop'): |
|
150 comp.dispatch(w=self.w, view=self) |
|
151 self.w(u'</div>') |
|
152 if self.main_related_section: |
148 if self.main_related_section: |
153 self.render_entity_relations(entity, siderelations) |
149 self.render_entity_relations(entity, siderelations) |
154 self.w(u'</td>') |
150 self.w(u'</td>') |
155 # side boxes |
151 # side boxes |
156 self.w(u'<td valign="top">') |
152 self.w(u'<td valign="top">') |
157 self.render_side_related(entity, siderelations) |
153 self.render_side_related(entity, siderelations) |
158 self.w(u'</td>') |
154 self.w(u'</td>') |
159 self.w(u'</tr>') |
155 self.w(u'</tr>') |
160 self.w(u'</table>') |
156 self.w(u'</table>') |
161 self.w(u'<div class="navcontentbottom">') |
157 self.content_navigation_components('navcontentbottom') |
|
158 |
|
159 def content_navigation_components(self, context): |
|
160 self.w(u'<div class="%s">' % context) |
162 for comp in self.vreg.possible_vobjects('contentnavigation', |
161 for comp in self.vreg.possible_vobjects('contentnavigation', |
163 self.req, self.rset, |
162 self.req, self.rset, row=self.row, |
164 view=self, context='navcontentbottom'): |
163 view=self, context=context): |
165 comp.dispatch(w=self.w, view=self) |
164 try: |
|
165 comp.dispatch(w=self.w, row=self.row, view=self) |
|
166 except NotImplementedError: |
|
167 warn('component %s doesnt implement cell_call, please update' |
|
168 % comp.__class__, DeprecationWarning) |
|
169 comp.dispatch(w=self.w, view=self) |
166 self.w(u'</div>') |
170 self.w(u'</div>') |
167 |
171 |
168 def iter_attributes(self, entity): |
172 def iter_attributes(self, entity): |
169 for rschema, targetschema in entity.e_schema.attribute_definitions(): |
173 for rschema, targetschema in entity.e_schema.attribute_definitions(): |
170 attr = rschema.type |
174 attr = rschema.type |
171 if attr in self.skip_attrs: |
175 if attr in self.skip_attrs: |
172 continue |
176 continue |