# HG changeset patch # User Nicolas Chauvat # Date 1302773807 -7200 # Node ID a4a115aab0868b8b66986ea6db4c1cd79c8454af # Parent e5833657c646e189d54396e866e3ae5b820c07c5 [facets] make rangefacet comply with start_unfolded (closes #1615869) diff -r e5833657c646 -r a4a115aab086 web/facet.py --- a/web/facet.py Thu Apr 14 14:19:21 2011 +0200 +++ b/web/facet.py Thu Apr 14 11:36:47 2011 +0200 @@ -1066,12 +1066,12 @@ ''' % (facetid + '_andor', _('and/or between different values'), _('OR'), _('AND'))) - cssclass = '' + cssclass = 'facetBody' if not self.facet.start_unfolded: cssclass += ' hidden' if len(self.items) > 6: cssclass += ' overflowed' - self.w(u'
\n' % cssclass) + self.w(u'
\n' % cssclass) for item in self.items: item.render(w=self.w) self.w(u'
\n') @@ -1140,6 +1140,10 @@ self.w(u'
\n' % facetid) self.w(u'
%s
\n' % (facetid, title)) + cssclass = 'facetBody' + if not self.facet.start_unfolded: + cssclass += ' hidden' + self.w(u'
\n' % cssclass) self.w(u' - ' % (sliderid, sliderid)) self.w(u'' @@ -1152,6 +1156,7 @@ % (facetid, self.maxvalue)) self.w(u'
' % sliderid) self.w(u'
\n') + self.w(u'
\n') class DateFacetRangeWidget(FacetRangeWidget): @@ -1183,15 +1188,15 @@ self.selected = selected def _render(self): + cssclass = 'facetValue facetCheckBox' if self.selected: - cssclass = ' facetValueSelected' + cssclass += ' facetValueSelected' imgsrc = self._cw.data_url(self.selected_img) imgalt = self._cw._('selected') else: - cssclass = '' imgsrc = self._cw.data_url(self.unselected_img) imgalt = self._cw._('not selected') - self.w(u'
\n' + self.w(u'
\n' % (cssclass, xml_escape(unicode(self.value)))) self.w(u'%s ' % (imgsrc, imgalt)) self.w(u'%s' % xml_escape(self.label)) @@ -1212,15 +1217,15 @@ title = xml_escape(self.facet.title) facetid = xml_escape(self.facet.__regid__) self.w(u'
\n' % facetid) + cssclass = 'facetValue facetCheckBox' if self.selected: - cssclass = ' facetValueSelected' + cssclass += ' facetValueSelected' imgsrc = self._cw.data_url(self.selected_img) imgalt = self._cw._('selected') else: - cssclass = '' imgsrc = self._cw.data_url(self.unselected_img) imgalt = self._cw._('not selected') - self.w(u'
\n' + self.w(u'
\n' % (cssclass, xml_escape(unicode(self.value)))) self.w(u'
') self.w(u'%s ' % (imgsrc, imgalt))