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
2319bd01cdfe
Commit
1828b7a3
authored
Jul 24, 2010
by
Nicolas Chauvat
Browse files
[views] remove link to other pictures and add explain similarity action
parent
326fcbfd0e39
Changes
1
Hide whitespace changes
Inline
Side-by-side
views.py
View file @
2319bd01
...
...
@@ -15,6 +15,7 @@ from cubicweb.web.views import primary, baseviews
from
cubicweb.web.facet
import
RelationFacet
,
AttributeFacet
,
RangeFacet
,
DateRangeFacet
from
cubes.similarity
import
get_vspace
from
cubes.similarity.views
import
SimilarAction
uicfg
.
primaryview_section
.
tag_subject_of
((
'ClassifiedAd'
,
'same_as'
,
'*'
),
'hidden'
)
uicfg
.
primaryview_section
.
tag_subject_of
((
'ClassifiedAd'
,
'url'
,
'*'
),
'hidden'
)
...
...
@@ -68,23 +69,12 @@ class ClassifiedAdInContextView(baseviews.SameETypeListItemView):
def
cell_call
(
self
,
row
,
col
,
contexteid
=
None
):
entity
=
self
.
cw_rset
.
get_entity
(
row
,
col
)
abs_url
=
entity
.
absolute_url
()
if
entity
.
url
:
link
=
entity
.
url
elif
entity
.
same_as
:
link
=
entity
.
same_as
[
0
].
uri
else
:
link
=
None
self
.
w
(
u
'<table><tr><td width="20%" align="right">'
)
if
entity
.
has_image
:
self
.
w
(
u
'<a href="%s"><img height="100" src="%s" /></a>'
%
(
abs_url
,
entity
.
has_image
[
0
].
uri
))
self
.
w
(
u
'</td><td>'
)
self
.
w
(
u
'<div><a href="%s">%s</a><br/>%s</div>'
%
(
abs_url
,
xml_escape
(
entity
.
title
or
u
''
),
xml_escape
(
entity
.
description
or
u
''
)))
if
link
:
self
.
w
(
u
'<div><a href="%s">'
%
link
)
self
.
w
(
u
'voir autres photos'
)
if
link
:
self
.
w
(
u
'</a></div>'
)
self
.
w
(
u
'</td></tr></table>'
)
# class ClassifiedPriceFacet(RangeFacet):
...
...
@@ -134,3 +124,6 @@ class ClosestAdsBox(box.EntityBoxTemplate):
self
.
w
(
u
'</div>'
)
self
.
w
(
u
'</div>'
)
self
.
w
(
u
'</div>'
)
class
ClassifiedAdSimilarAction
(
SimilarAction
):
__select__
=
is_instance
(
'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