web/facet.py
changeset 3023 7864fee8b4ec
parent 2890 fdcb8a2bb6eb
parent 2996 866a2c135c33
child 3369 7b88d12b4ee2
equal deleted inserted replaced
2968:0e3460341023 3023:7864fee8b4ec
   716             cssclass = ''
   716             cssclass = ''
   717             imgsrc = self.req.datadir_url + self.unselected_img
   717             imgsrc = self.req.datadir_url + self.unselected_img
   718             imgalt = self.req._('not selected')
   718             imgalt = self.req._('not selected')
   719         self.w(u'<div class="facetValue facetCheckBox%s" cubicweb:value="%s">\n'
   719         self.w(u'<div class="facetValue facetCheckBox%s" cubicweb:value="%s">\n'
   720                % (cssclass, xml_escape(unicode(self.value))))
   720                % (cssclass, xml_escape(unicode(self.value))))
   721         self.w(u'<img src="%s" alt="%s"/>&nbsp;' % (imgsrc, imgalt))
   721         self.w(u'<img src="%s" alt="%s"/>&#160;' % (imgsrc, imgalt))
   722         self.w(u'<a href="javascript: {}">%s</a>' % xml_escape(self.label))
   722         self.w(u'<a href="javascript: {}">%s</a>' % xml_escape(self.label))
   723         self.w(u'</div>')
   723         self.w(u'</div>')
   724 
   724 
   725 class CheckBoxFacetWidget(HTMLWidget):
   725 class CheckBoxFacetWidget(HTMLWidget):
   726     selected_img = "black-check.png"
   726     selected_img = "black-check.png"
   745             imgsrc = self.req.datadir_url + self.unselected_img
   745             imgsrc = self.req.datadir_url + self.unselected_img
   746             imgalt = self.req._('not selected')
   746             imgalt = self.req._('not selected')
   747         self.w(u'<div class="facetValue facetCheckBox%s" cubicweb:value="%s">\n'
   747         self.w(u'<div class="facetValue facetCheckBox%s" cubicweb:value="%s">\n'
   748                % (cssclass, xml_escape(unicode(self.value))))
   748                % (cssclass, xml_escape(unicode(self.value))))
   749         self.w(u'<div class="facetCheckBoxWidget">')
   749         self.w(u'<div class="facetCheckBoxWidget">')
   750         self.w(u'<img src="%s" alt="%s" cubicweb:unselimg="true" />&nbsp;' % (imgsrc, imgalt))
   750         self.w(u'<img src="%s" alt="%s" cubicweb:unselimg="true" />&#160;' % (imgsrc, imgalt))
   751         self.w(u'<label class="facetTitle" cubicweb:facetName="%s"><a href="javascript: {}">%s</a></label>' % (facetid, title))
   751         self.w(u'<label class="facetTitle" cubicweb:facetName="%s"><a href="javascript: {}">%s</a></label>' % (facetid, title))
   752         self.w(u'</div>\n')
   752         self.w(u'</div>\n')
   753         self.w(u'</div>\n')
   753         self.w(u'</div>\n')
   754         self.w(u'</div>\n')
   754         self.w(u'</div>\n')
   755 
   755 
   756 class FacetSeparator(HTMLWidget):
   756 class FacetSeparator(HTMLWidget):
   757     def __init__(self, label=None):
   757     def __init__(self, label=None):
   758         self.label = label or u'&nbsp;'
   758         self.label = label or u'&#160;'
   759 
   759 
   760     def _render(self):
   760     def _render(self):
   761         pass
   761         pass