[rhmessaging-commits] rhmessaging commits: r3611 - in mgmt/trunk/cumin/python/cumin: grid and 1 other directory.

rhmessaging-commits at lists.jboss.org rhmessaging-commits at lists.jboss.org
Tue Sep 1 17:25:28 EDT 2009


Author: justi9
Date: 2009-09-01 17:25:28 -0400 (Tue, 01 Sep 2009)
New Revision: 3611

Modified:
   mgmt/trunk/cumin/python/cumin/grid/submission.py
   mgmt/trunk/cumin/python/cumin/widgets.py
   mgmt/trunk/cumin/python/cumin/widgets.strings
Log:
 * Restore column truncation, though there's still a rendering problem

 * Put "links" on CuminTable, for adding navigation buttons

 * Make submission set an ordinary CuminTable, since it has no
   selection actions

 * Make the links widget set not render at all if there are no links
   associated with it


Modified: mgmt/trunk/cumin/python/cumin/grid/submission.py
===================================================================
--- mgmt/trunk/cumin/python/cumin/grid/submission.py	2009-09-01 18:28:36 UTC (rev 3610)
+++ mgmt/trunk/cumin/python/cumin/grid/submission.py	2009-09-01 21:25:28 UTC (rev 3611)
@@ -9,10 +9,9 @@
 strings = StringCatalog(__file__)
 log = logging.getLogger("cumin.grid.submission")
 
-class SubmissionSet(CuminSelectionTable):
+class SubmissionSet(CuminTable):
     def __init__(self, app, name):
-        item = SubmissionParameter(app, "item")
-        super(SubmissionSet, self).__init__(app, name, item)
+        super(SubmissionSet, self).__init__(app, name)
 
         col = self.NameColumn(app, "name")
         self.add_column(col)

Modified: mgmt/trunk/cumin/python/cumin/widgets.py
===================================================================
--- mgmt/trunk/cumin/python/cumin/widgets.py	2009-09-01 18:28:36 UTC (rev 3610)
+++ mgmt/trunk/cumin/python/cumin/widgets.py	2009-09-01 21:25:28 UTC (rev 3611)
@@ -745,11 +745,20 @@
     def __init__(self, app, name):
         super(CuminTable, self).__init__(app, name)
 
+        self.update_enabled = True
+
         self.paginator = Paginator(app, "page")
         self.add_child(self.paginator)
 
-        self.update_enabled = True
+        self.links = self.Links(app, "links")
+        self.links.html_class = "actions" # XXX fix this
+        self.add_child(self.links)
 
+    class Links(WidgetSet):
+        def do_render(self, session):
+            if len(self.children):
+                return super(CuminTable.Links, self).do_render(session)
+
     def get_connection(self, session):
         return self.app.model.get_sql_connection()
 
@@ -814,10 +823,6 @@
         self.buttons.html_class = "buttons"
         self.add_child(self.buttons)
 
-        self.links = WidgetSet(app, "links")
-        self.links.html_class = "actions" # XXX fix this
-        self.add_child(self.links)
-
 class CuminQMFSelectionTable(CuminSelectionTable):
     def filter_item(self, session, item):
         return True

Modified: mgmt/trunk/cumin/python/cumin/widgets.strings
===================================================================
--- mgmt/trunk/cumin/python/cumin/widgets.strings	2009-09-01 18:28:36 UTC (rev 3610)
+++ mgmt/trunk/cumin/python/cumin/widgets.strings	2009-09-01 21:25:28 UTC (rev 3611)
@@ -485,11 +485,11 @@
     clear: both;
 }
 
-table.CuminTable td {
+div.CuminTable > table td {
   text-overflow:ellipsis;
 }
 
-table.truncate {
+div.truncate > table {
   table-layout: fixed;
   min-width: 600px;
 }
@@ -503,21 +503,27 @@
 wooly.addPageUpdateListener(cumin.restoreTableCheckboxes);
 
 [CuminTable.html]
-<table id="{id}" class="CuminTable mobjects {extra_class}">
-  <thead>
-    <tr>
-      <th class="setnav" colspan="{column_count}">
-        <div class="rfloat">{page}</div>
-        {count}
-      </th>
-    </tr>
-    <tr>{headers}</tr>
-  </thead>
-  <tbody>{items}</tbody>
-</table>
+<div id="{id}" class="CuminTable {extra_class}">
+  {links}
 
+  <table class="mobjects">
+    <thead>
+      <tr>
+        <th class="setnav" colspan="{column_count}">
+          <div class="rfloat">{page}</div>
+          {count}
+        </th>
+      </tr>
+      <tr>{headers}</tr>
+    </thead>
+    <tbody>{items}</tbody>
+  </table>
+</div>
+
 [CuminTableWithControls.html]
 <div id="{id}" class="CuminTable {extra_class}">
+  {links}
+
   {filters}
 
   {switches}



More information about the rhmessaging-commits mailing list