# HG changeset patch # User Aurelien Campeas # Date 1305911341 -7200 # Node ID 94ad9523abb778c9cbe4ed7a4cc355b138e85232 # Parent 9179ae452159b8b81d648ed5dc4cfcf892cffa31 [web/facet|views/table] bump a bit some heights, split table view methods for easier subclassing diff -r 9179ae452159 -r 94ad9523abb7 web/facet.py --- a/web/facet.py Fri May 20 17:29:50 2011 +0200 +++ b/web/facet.py Fri May 20 19:09:01 2011 +0200 @@ -1096,7 +1096,7 @@ self.value = None def height(self): - return 2 + return 3 def _render(self): title = xml_escape(self.facet.title) @@ -1232,7 +1232,7 @@ self.selected = selected def height(self): - return 1 + return 2 def _render(self): title = xml_escape(self.facet.title) diff -r 9179ae452159 -r 94ad9523abb7 web/views/tableview.py --- a/web/views/tableview.py Fri May 20 17:29:50 2011 +0200 +++ b/web/views/tableview.py Fri May 20 19:09:01 2011 +0200 @@ -83,12 +83,18 @@ w(u'') filter_hiddens(w, facets=','.join(wdg.facet.__regid__ for wdg in fwidgets), baserql=baserql) - # sort by vocab size + self._build_form_table(fwidgets) + + def _facet_widget_sort(self, fwidgets): fwidgets.sort(key=lambda x: x.height()) + + def _build_form_table(self, fwidgets): + # sort by widget height + w = self.w + self._facet_widget_sort(fwidgets) w(u'\n') widget_queue = [] queue_size = 0 - widget_qty = len(fwidgets) w(u'\n') for wdg in fwidgets: height = wdg.height()