290 def show_hide_filter_actions(self, currentlydisplayed=False): |
290 def show_hide_filter_actions(self, currentlydisplayed=False): |
291 divid = self.view.domid |
291 divid = self.view.domid |
292 showhide = u';'.join(toggle_action('%s%s' % (divid, what))[11:] |
292 showhide = u';'.join(toggle_action('%s%s' % (divid, what))[11:] |
293 for what in ('Form', 'Show', 'Hide', 'Actions')) |
293 for what in ('Form', 'Show', 'Hide', 'Actions')) |
294 showhide = 'javascript:' + showhide |
294 showhide = 'javascript:' + showhide |
|
295 self._cw.add_onload(u'''\ |
|
296 $(document).ready(function() { |
|
297 if ($('#%(id)sForm[class=\"hidden\"]').length) { |
|
298 $('#%(id)sHide').attr('class', 'hidden'); |
|
299 } else { |
|
300 $('#%(id)sShow').attr('class', 'hidden'); |
|
301 } |
|
302 });''' % {'id': divid}) |
295 showlabel = self._cw._('show filter form') |
303 showlabel = self._cw._('show filter form') |
296 hidelabel = self._cw._('hide filter form') |
304 hidelabel = self._cw._('hide filter form') |
297 if currentlydisplayed: |
305 return [component.Link(showhide, showlabel, id='%sShow' % divid), |
298 c1, d1 = 'hidden', '%sShow' % divid |
306 component.Link(showhide, hidelabel, id='%sHide' % divid)] |
299 c2, d2 = None, '%sHide' % divid |
|
300 else: |
|
301 c1, d1 = None, '%sShow' % divid |
|
302 c2, d2 = 'hidden', '%sHide' % divid |
|
303 return [component.Link(showhide, showlabel, klass=c1, id=d1), |
|
304 component.Link(showhide, hidelabel, klass=c2, id=d2)] |
|
305 |
307 |
306 |
308 |
307 class AbstractColumnRenderer(object): |
309 class AbstractColumnRenderer(object): |
308 """Abstract base class for column renderer. Interface of a column renderer follows: |
310 """Abstract base class for column renderer. Interface of a column renderer follows: |
309 |
311 |