[rhmessaging-commits] rhmessaging commits: r1757 - in mgmt: notes and 1 other directory.

rhmessaging-commits at lists.jboss.org rhmessaging-commits at lists.jboss.org
Mon Mar 3 21:56:17 EST 2008


Author: justi9
Date: 2008-03-03 21:56:17 -0500 (Mon, 03 Mar 2008)
New Revision: 1757

Modified:
   mgmt/cumin/python/wooly/tables.py
   mgmt/cumin/python/wooly/tables.strings
   mgmt/notes/justin-todo.txt
Log:
Add a sort direction indicator to table headings.



Modified: mgmt/cumin/python/wooly/tables.py
===================================================================
--- mgmt/cumin/python/wooly/tables.py	2008-03-03 22:03:18 UTC (rev 1756)
+++ mgmt/cumin/python/wooly/tables.py	2008-03-04 02:56:17 UTC (rev 1757)
@@ -27,13 +27,13 @@
 
         header = column.header_class(self.app, "head", column)
         self.set_header(column, header)
+        self.add_child(header)
 
         if self.scolumn.default is None:
             self.scolumn.default = column.name
 
     def set_header(self, column, header):
         self.headers_by_column[column] = header
-        self.add_child(header)
 
     def get_selected_column(self, session):
         name = self.scolumn.get(session)
@@ -111,10 +111,12 @@
     def render_href(self, session, object):
         branch = session.branch()
 
-        if self.column.name == self.parent.scolumn.get(session):
-            self.parent.reversed.set(branch,
-                                     not self.parent.reversed.get(session))
+        sel = self.parent.get_selected_column(session)
 
+        if sel is self.column:
+            self.parent.reversed.set \
+                (branch, not self.parent.reversed.get(session))
+
         self.parent.scolumn.set(branch, self.column.name)
 
         return branch.marshal()
@@ -122,9 +124,18 @@
     def render_content(self, session, object):
         return self.column.get_title(session, object)
 
-    def render_class_attr(self, session, args):
+    def render_class_attr(self, session, object):
         return self.column.get_class_attr(session)
 
+    def render_sort_arrow(self, session, object):
+        sel = self.parent.get_selected_column(session)
+
+        if sel is self.column:
+            if self.parent.reversed.get(session):
+                return "^"
+            else:
+                return "v"
+
 class SqlTable(ItemTable):
     def __init__(self, app, name):
         super(SqlTable, self).__init__(app, name)

Modified: mgmt/cumin/python/wooly/tables.strings
===================================================================
--- mgmt/cumin/python/wooly/tables.strings	2008-03-03 22:03:18 UTC (rev 1756)
+++ mgmt/cumin/python/wooly/tables.strings	2008-03-04 02:56:17 UTC (rev 1757)
@@ -8,4 +8,4 @@
 <tr>{cells}</tr>
 
 [ItemTableColumnHeader.html]
-<th {class_attr}><a href="{href}">{content}</a></th>
+<th {class_attr}><a href="{href}">{content} {sort_arrow}</a></th>

Modified: mgmt/notes/justin-todo.txt
===================================================================
--- mgmt/notes/justin-todo.txt	2008-03-03 22:03:18 UTC (rev 1756)
+++ mgmt/notes/justin-todo.txt	2008-03-04 02:56:17 UTC (rev 1757)
@@ -1,11 +1,11 @@
 Current
 
- * Tables: Add sort direction icon
-
  * Tables: Make null values in tables dashes, not zeroes
 
  * Get rid of single object confirms
 
+ * Investigate the double registration printout
+
 Deferred
 
  * Blow up if we try to call set_redirect_url twice in a session




More information about the rhmessaging-commits mailing list