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
4a3aab144037
Commit
60d6b024
authored
May 23, 2010
by
Nicolas Chauvat
Browse files
[views] thumbnails gallery for ads
parent
3d6e44cf83f6
Changes
1
Hide whitespace changes
Inline
Side-by-side
views.py
View file @
4a3aab14
...
...
@@ -44,13 +44,22 @@ class ExternalUriComponent(component.EntityVComponent):
self
.
w
(
u
'</div>'
)
### end of generic component
class
AdGallery
(
baseviews
.
EntityView
):
__regid__
=
'gallery'
title
=
_
(
'gallery'
)
__select__
=
implements
(
'ClassifiedAd'
)
def
call
(
self
):
for
entity
in
self
.
cw_rset
.
entities
():
for
img
in
entity
.
has_image
:
self
.
w
(
u
'<img style="max-height: 100px; padding: 2px" src="%s" />'
%
img
.
uri
)
class
ClassifiedAdPrimaryView
(
primary
.
PrimaryView
):
__select__
=
primary
.
PrimaryView
.
__select__
&
implements
(
'ClassifiedAd'
)
def
render_entity_relations
(
self
,
entity
):
super
(
ClassifiedAdPrimaryView
,
self
).
render_entity_relations
(
entity
)
if
entity
.
has_image
:
self
.
w
(
u
'<div><img style="max-height: 100px" src="%s" /></div>'
%
entity
.
has_image
[
0
].
uri
)
self
.
wview
(
'gallery-of-ads'
,
self
.
cw_rset
,
'null'
)
class
ClassifiedAdInContextView
(
baseviews
.
SameETypeListItemView
):
__select__
=
implements
(
'ClassifiedAd'
)
...
...
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