Commit 66c0c44e authored by Jean-Paul Smets's avatar Jean-Paul Smets

Better support of URLs and extension for rendering

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@12572 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 177e58d5
...@@ -817,7 +817,7 @@ class ListBoxRenderer: ...@@ -817,7 +817,7 @@ class ListBoxRenderer:
def getListActionUrl(self): def getListActionUrl(self):
"""Return the URL of the list action. """Return the URL of the list action.
""" """
list_action_part_list = [self.getContext().getUrl(), '/', self.field.get_value('list_action')] list_action_part_list = [self.getContext().absolute_url(), '/', self.field.get_value('list_action')]
if '?' in list_action_part_list[-1]: if '?' in list_action_part_list[-1]:
list_action_part_list.append('&reset=1') list_action_part_list.append('&reset=1')
else: else:
...@@ -2149,8 +2149,11 @@ class ListBoxHTMLRenderer(ListBoxRenderer): ...@@ -2149,8 +2149,11 @@ class ListBoxHTMLRenderer(ListBoxRenderer):
except AttributeError: except AttributeError:
return getattr(context.getPortalObject(), method_id).__of__(context) return getattr(context.getPortalObject(), method_id).__of__(context)
return aq_base(getattr(self.getContext(), method_id)).__of__(context) return aq_base(getattr(self.getContext(), method_id)).__of__(context)
# Try to get a page template from acquisition and fallback on default page template. # Try to get a page template from acquisition context then portal object
return getattr(context.getPortalObject(), 'ListBox_asHTML', context.asHTML).__of__(context) # and fallback on default page template.
return getattr(self.getContext(), 'ListBox_asHTML',
getattr(context.getPortalObject(), 'ListBox_asHTML', context.asHTML)
).__of__(context)
def render(self, **kw): def render(self, **kw):
"""Render the data in HTML. """Render the data in HTML.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment