Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
cubicweb
cubes
classifiedad
Commits
8589be6583ff
Commit
ce73ac10
authored
May 16, 2010
by
Nicolas Chauvat
Browse files
[views] fix externaluricomponent (same_as is symetric)
parent
6605bce14e2f
Changes
1
Hide whitespace changes
Inline
Side-by-side
views.py
View file @
8589be65
...
...
@@ -25,7 +25,7 @@ uicfg.actionbox_appearsin_addmenu.tag_subject_of(('ClassifiedAd', 'has_image', '
class
ExternalUriComponent
(
component
.
EntityVComponent
):
"""component to display link to external uri"""
__regid__
=
'externaluricomp'
__select__
=
(
component
.
EntityVComponent
.
__select__
&
has_related_entities
(
'same_as'
))
__select__
=
(
component
.
EntityVComponent
.
__select__
&
has_related_entities
(
'same_as'
)
&
~
implements
(
'ExternalUri'
)
)
context
=
'ctxtoolbar'
...
...
@@ -36,7 +36,7 @@ class ExternalUriComponent(component.EntityVComponent):
entity
=
self
.
cw_rset
.
get_entity
(
row
,
col
)
self
.
w
(
u
'<div class="toolbarButton" id="%s">'
%
self
.
div_id
())
imgurl
=
self
.
_cw
.
external_resource
(
'BLUE_ARROW'
)
if
entity
.
url
:
if
hasattr
(
entity
,
'
url
'
)
:
url
=
entity
.
url
else
:
url
=
entity
.
same_as
[
0
].
uri
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment