Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
cubicweb
cubes
classifiedad
Commits
720f400b312d
Commit
d45cf8b8
authored
Aug 01, 2010
by
Nicolas Chauvat
Browse files
externaluri toolbar component moved to cube datafeed
parent
ce57a6af8e88
Changes
3
Show whitespace changes
Inline
Side-by-side
data/blue_arrow.png
deleted
100644 → 0
View file @
ce57a6af
975 Bytes
uiprops.py
deleted
100644 → 0
View file @
ce57a6af
BLUE_ARROW
=
data
(
'blue_arrow.png'
)
\ No newline at end of file
views.py
View file @
720f400b
...
...
@@ -24,29 +24,6 @@ uicfg.primaryview_section.tag_subject_of(('ClassifiedAd', 'has_image', '*'), 'hi
uicfg
.
primaryview_section
.
tag_subject_of
((
'ClassifiedAd'
,
'title'
,
'*'
),
'hidden'
)
uicfg
.
actionbox_appearsin_addmenu
.
tag_subject_of
((
'ClassifiedAd'
,
'has_image'
,
'*'
),
True
)
# XXX this component looks generic... move it to cubicweb ?
class
ExternalUriComponent
(
component
.
EntityVComponent
):
"""component to display link to external uri"""
__regid__
=
'externaluricomp'
__select__
=
(
component
.
EntityVComponent
.
__select__
&
has_related_entities
(
'same_as'
)
&
~
is_instance
(
'ExternalUri'
))
context
=
'ctxtoolbar'
def
call
(
self
,
view
=
None
):
self
.
cell_call
(
self
.
row
or
0
,
self
.
col
or
0
)
def
cell_call
(
self
,
row
,
col
,
view
=
None
):
entity
=
self
.
cw_rset
.
get_entity
(
row
,
col
)
self
.
w
(
u
'<div class="toolbarButton" id="%s">'
%
self
.
div_id
())
imgurl
=
self
.
_cw
.
uiprops
[
'BLUE_ARROW'
]
if
hasattr
(
entity
,
'url'
):
url
=
entity
.
url
else
:
url
=
entity
.
same_as
[
0
].
uri
self
.
w
(
u
'<a href="%s"><img src="%s"/></a>'
%
(
url
,
xml_escape
(
imgurl
)))
self
.
w
(
u
'</div>'
)
### end of generic component
class
ExternalUriGallery
(
baseviews
.
EntityView
):
__regid__
=
'gallery'
title
=
_
(
'gallery'
)
...
...
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