web/views/facets.py
branchstable
changeset 2339 00b704535984
parent 2337 6620e5abcd99
parent 2326 05ae71d9a069
child 2340 65445ae67db0
--- a/web/views/facets.py	Wed Jul 08 13:58:37 2009 +0200
+++ b/web/views/facets.py	Wed Jul 08 13:59:22 2009 +0200
@@ -9,7 +9,7 @@
 
 from simplejson import dumps
 
-from logilab.mtconverter import html_escape
+from logilab.mtconverter import xml_escape
 
 from cubicweb.vregistry import objectify_selector
 from cubicweb.selectors import (non_final_entity, two_lines_rset,
@@ -42,7 +42,7 @@
     needs_css = 'cubicweb.facets.css'
     needs_js = ('cubicweb.ajax.js', 'cubicweb.formfilter.js')
 
-    bkLinkBox_template = u'<div class="facetTitle">%s</div>'
+    bk_linkbox_template = u'<div class="facetTitle">%s</div>'
 
     def facetargs(self):
         """this method returns the list of extra arguments that should
@@ -83,11 +83,11 @@
                         widgets.append(wdg)
             if not widgets:
                 return
-            if self.bkLinkBox_template:
-                self.displayBookmarkLink(rset)
+            if self.bk_linkbox_template:
+                self.display_bookmark_link(rset)
             w = self.w
             w(u'<form method="post" id="%sForm" cubicweb:facetargs="%s" action="">'  % (
-                divid, html_escape(dumps([divid, vid, paginate, self.facetargs()]))))
+                divid, xml_escape(dumps([divid, vid, paginate, self.facetargs()]))))
             w(u'<fieldset>')
             hiddens = {'facets': ','.join(wdg.facet.id for wdg in widgets),
                        'baserql': baserql}
@@ -103,7 +103,7 @@
             import cubicweb
             cubicweb.info('after facets with rql: %s' % repr(rqlst))
 
-    def displayBookmarkLink(self, rset):
+    def display_bookmark_link(self, rset):
         eschema = self.schema.eschema('Bookmark')
         if eschema.has_perm(self.req, 'add'):
             bk_path = 'view?rql=%s' % rset.printable_rql()
@@ -112,10 +112,10 @@
             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)
             bk_link = u'<a cubicweb:target="%s" id="facetBkLink" href="%s">%s</a>' % (
-                    html_escape(bk_base_url),
-                    html_escape(bk_add_url),
+                    xml_escape(bk_base_url),
+                    xml_escape(bk_add_url),
                     self.req._('bookmark this search'))
-            self.w(self.bkLinkBox_template % bk_link)
+            self.w(self.bk_linkbox_template % bk_link)
 
     def get_facets(self, rset, mainvar):
         return self.vreg.possible_vobjects('facets', self.req, rset,