web/views/facets.py
changeset 5940 0e3ae19b181a
parent 5424 8ecbcbff9777
child 6040 9ae260b2d1c4
equal deleted inserted replaced
5939:a33402c1aa79 5940:0e3ae19b181a
    13 # FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public License for more
    13 # FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public License for more
    14 # details.
    14 # details.
    15 #
    15 #
    16 # You should have received a copy of the GNU Lesser General Public License along
    16 # You should have received a copy of the GNU Lesser General Public License along
    17 # with CubicWeb.  If not, see <http://www.gnu.org/licenses/>.
    17 # with CubicWeb.  If not, see <http://www.gnu.org/licenses/>.
    18 """the facets box and some basic facets
    18 """the facets box and some basic facets"""
    19 
    19 
    20 """
       
    21 __docformat__ = "restructuredtext en"
    20 __docformat__ = "restructuredtext en"
    22 
    21 
    23 from logilab.mtconverter import xml_escape
    22 from logilab.mtconverter import xml_escape
    24 
    23 
    25 from cubicweb.appobject import objectify_selector
    24 from cubicweb.appobject import objectify_selector
    26 from cubicweb.selectors import (non_final_entity, multi_lines_rset,
    25 from cubicweb.selectors import (non_final_entity, multi_lines_rset,
    27                                 match_context_prop, yes, relation_possible)
    26                                 match_context_prop, yes, relation_possible)
    28 from cubicweb.web import dumps
    27 from cubicweb.utils import json_dumps
    29 from cubicweb.web.box import BoxTemplate
    28 from cubicweb.web.box import BoxTemplate
    30 from cubicweb.web.facet import (AbstractFacet, FacetStringWidget, RelationFacet,
    29 from cubicweb.web.facet import (AbstractFacet, FacetStringWidget, RelationFacet,
    31                                 prepare_facets_rqlst, filter_hiddens, _cleanup_rqlst,
    30                                 prepare_facets_rqlst, filter_hiddens, _cleanup_rqlst,
    32                                 _prepare_vocabulary_rqlst)
    31                                 _prepare_vocabulary_rqlst)
    33 
    32 
   100             vid = req.form.get('vid')
    99             vid = req.form.get('vid')
   101         if self.bk_linkbox_template:
   100         if self.bk_linkbox_template:
   102             self.display_bookmark_link(rset)
   101             self.display_bookmark_link(rset)
   103         w = self.w
   102         w = self.w
   104         w(u'<form method="post" id="%sForm" cubicweb:facetargs="%s" action="">'  % (
   103         w(u'<form method="post" id="%sForm" cubicweb:facetargs="%s" action="">'  % (
   105             divid, xml_escape(dumps([divid, vid, paginate, self.facetargs()]))))
   104             divid, xml_escape(json_dumps([divid, vid, paginate, self.facetargs()]))))
   106         w(u'<fieldset>')
   105         w(u'<fieldset>')
   107         hiddens = {'facets': ','.join(wdg.facet.__regid__ for wdg in widgets),
   106         hiddens = {'facets': ','.join(wdg.facet.__regid__ for wdg in widgets),
   108                    'baserql': baserql}
   107                    'baserql': baserql}
   109         for param in ('subvid', 'vtitle'):
   108         for param in ('subvid', 'vtitle'):
   110             if param in req.form:
   109             if param in req.form: