set bookmarked_by relation on facet bookmarking
authorNicolas Chauvat <nicolas.chauvat@logilab.fr>
Thu, 06 Nov 2008 16:28:25 +0100
changeset 8 8cdf3ed28e64
parent 7 36dc7906bb46
child 9 1901fcf55ed4
set bookmarked_by relation on facet bookmarking
web/views/facets.py
--- a/web/views/facets.py	Thu Nov 06 14:15:21 2008 +0100
+++ b/web/views/facets.py	Thu Nov 06 16:28:25 2008 +0100
@@ -76,9 +76,10 @@
             if eschema.has_perm(req, 'add'):
                 bk_path = 'view?rql=%s' % rset.printable_rql()
                 bk_title = req._('my custom search')
-                bk_add_url = self.build_url('add/Bookmark', path=bk_path, title=bk_title)
-                bk_base_url = self.build_url('add/Bookmark', title=bk_title)
-                w(u'<div class="bkSearch"><a cubicweb:target="%s" id="facetBkLink" href="%s">%s</a></div>' % (
+                linkto = 'bookmarked_by:%s:subject' % self.req.user.eid
+                bk_add_url = self.build_url('add/Bookmark', path=bk_path, title=bk_title, __linkto=linkto)
+                bk_base_url = self.build_url('add/Bookmark', title=bk_title, __linkto=linkto)
+                w(u'<div class="facetTitle"><a cubicweb:target="%s" id="facetBkLink" href="%s">%s</a></div>' % (
                     html_escape(bk_base_url),
                     html_escape(bk_add_url),
                     req._('bookmark this search')))