equal
deleted
inserted
replaced
505 self.items.append(item) |
505 self.items.append(item) |
506 |
506 |
507 def _render(self): |
507 def _render(self): |
508 title = html_escape(self.facet.title) |
508 title = html_escape(self.facet.title) |
509 facetid = html_escape(self.facet.id) |
509 facetid = html_escape(self.facet.id) |
510 if len(self.items) > 6: |
510 self.w(u'<div id="%s" class="facet">\n' % facetid) |
511 self.w(u'<div id="%s" class="facet overflowed">\n' % facetid) |
|
512 else: |
|
513 self.w(u'<div id="%s" class="facet">\n' % facetid) |
|
514 self.w(u'<div class="facetTitle" cubicweb:facetName="%s">%s</div>\n' % |
511 self.w(u'<div class="facetTitle" cubicweb:facetName="%s">%s</div>\n' % |
515 (html_escape(facetid), title)) |
512 (html_escape(facetid), title)) |
516 if self.facet.support_and(): |
513 if self.facet.support_and(): |
517 _ = self.facet.req._ |
514 _ = self.facet.req._ |
518 self.w(u'''<select name="%s" class="radio facetOperator" title="%s"> |
515 self.w(u'''<select name="%s" class="radio facetOperator" title="%s"> |
521 </select>''' % (facetid + '_andor', _('and/or between different values'), |
518 </select>''' % (facetid + '_andor', _('and/or between different values'), |
522 _('OR'), _('AND'))) |
519 _('OR'), _('AND'))) |
523 cssclass = '' |
520 cssclass = '' |
524 if not self.facet.start_unfolded: |
521 if not self.facet.start_unfolded: |
525 cssclass += ' hidden' |
522 cssclass += ' hidden' |
|
523 if len(self.items) > 6: |
|
524 cssclass +=' overflowed' |
526 self.w(u'<div class="facetBody%s">\n' % cssclass) |
525 self.w(u'<div class="facetBody%s">\n' % cssclass) |
527 for item in self.items: |
526 for item in self.items: |
528 item.render(self.w) |
527 item.render(self.w) |
529 self.w(u'</div>\n') |
528 self.w(u'</div>\n') |
530 self.w(u'</div>\n') |
529 self.w(u'</div>\n') |