--- a/web/formrenderers.py Wed May 27 15:19:25 2009 +0200
+++ b/web/formrenderers.py Wed May 27 16:41:51 2009 +0200
@@ -390,6 +390,8 @@
def inline_entities_form(self, w, form):
"""create a form to edit entity's inlined relations"""
+ if not hasattr(form, 'inlined_relations'):
+ return
entity = form.edited_entity
__ = form.req.__
for rschema, targettypes, role in form.inlined_relations():
@@ -456,6 +458,9 @@
'#<span class="icounter">1</span> '
'[<a href="javascript: %(removejs)s;noop();">%(removemsg)s</a>]</div>'
% values)
+ # cleanup values
+ for key in ('title', 'removejs', 'removemsg'):
+ values.pop(key)
self.render_fields(w, form, values)
w(u'</div></div>')
return '\n'.join(data)
--- a/web/views/autoform.py Wed May 27 15:19:25 2009 +0200
+++ b/web/views/autoform.py Wed May 27 16:41:51 2009 +0200
@@ -189,7 +189,8 @@
"""
# we'll need an initialized varmaker if there are some inlined relation
self.initialize_varmaker()
- return self.erelations_by_category(self.edited_entity, True, 'add', self.rinlined)
+ return self.erelations_by_category(self.edited_entity, True, 'add',
+ self.rinlined)
def srelations_by_category(self, categories=None, permission=None):
"""filter out result of relations_by_category(categories, permission) by
--- a/web/views/basecomponents.py Wed May 27 15:19:25 2009 +0200
+++ b/web/views/basecomponents.py Wed May 27 16:41:51 2009 +0200
@@ -20,7 +20,7 @@
BoxLink)
VISIBLE_PROP_DEF = {
- _('visible'): dict(type='Boolean', default=False,
+ _('visible'): dict(type='Boolean', default=True,
help=_('display the component or not')),
}
@@ -125,9 +125,8 @@
"""
__select__ = yes()
id = 'applmessages'
- property_defs = VISIBLE_PROP_DEF
# don't want user to hide this component using an cwproperty
- site_wide = True
+ property_defs = {}
def call(self):
msgs = [msg for msg in (self.req.get_shared_data('sources_error', pop=True),
--- a/web/views/editforms.py Wed May 27 15:19:25 2009 +0200
+++ b/web/views/editforms.py Wed May 27 16:41:51 2009 +0200
@@ -6,6 +6,7 @@
:contact: http://www.logilab.fr/ -- mailto:contact@logilab.fr
"""
__docformat__ = "restructuredtext en"
+_ = unicode
from copy import copy
@@ -26,7 +27,6 @@
EntityCompositeFormRenderer,
EntityInlinedFormRenderer)
-_ = unicode
def relation_id(eid, rtype, role, reid):
"""return an identifier for a relation between two entities"""