Commit df3cb640 authored by Alexandre Boeglin's avatar Alexandre Boeglin

RelationStringField displayed in non editable mode is now rendered as a clickable URL.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@1889 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 166e409a
...@@ -128,8 +128,10 @@ class RelationStringFieldWidget(Widget.TextWidget): ...@@ -128,8 +128,10 @@ class RelationStringFieldWidget(Widget.TextWidget):
html_string = Widget.TextWidget.render_view(self, field, value) html_string = Widget.TextWidget.render_view(self, field, value)
portal_url_string = getToolByName(here, 'portal_url')() portal_url_string = getToolByName(here, 'portal_url')()
if value not in ('', None): if value not in ('', None):
html_string = '<a href="%s/%s?field_id=%s&form_id=%s">%s</a>' \
% (here.absolute_url(), field.get_value('jump_method'), field.id, field.aq_parent.id, html_string)
html_string += '&nbsp;&nbsp;<a href="%s/%s?field_id=%s&form_id=%s"><img src="%s/images/jump.png"></a>' \ html_string += '&nbsp;&nbsp;<a href="%s/%s?field_id=%s&form_id=%s"><img src="%s/images/jump.png"></a>' \
% (here.absolute_url(), field.get_value('jump_method'), field.id, field.aq_parent.id,portal_url_string) % (here.absolute_url(), field.get_value('jump_method'), field.id, field.aq_parent.id, portal_url_string)
return html_string return html_string
RelationStringFieldWidgetInstance = RelationStringFieldWidget() RelationStringFieldWidgetInstance = RelationStringFieldWidget()
......
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