[rhmessaging-commits] rhmessaging commits: r984 - in mgmt/cumin/python: wooly and 1 other directory.

rhmessaging-commits at lists.jboss.org rhmessaging-commits at lists.jboss.org
Tue Oct 9 13:58:21 EDT 2007


Author: justi9
Date: 2007-10-09 13:58:20 -0400 (Tue, 09 Oct 2007)
New Revision: 984

Modified:
   mgmt/cumin/python/cumin/page.strings
   mgmt/cumin/python/cumin/server.py
   mgmt/cumin/python/cumin/widgets.py
   mgmt/cumin/python/wooly/widgets.py
Log:
Improves handling of cases in the UI where a set is empty or a scalar
property is not set.



Modified: mgmt/cumin/python/cumin/page.strings
===================================================================
--- mgmt/cumin/python/cumin/page.strings	2007-10-09 17:45:25 UTC (rev 983)
+++ mgmt/cumin/python/cumin/page.strings	2007-10-09 17:58:20 UTC (rev 984)
@@ -30,6 +30,11 @@
   list-style: none;
 }
 
+span.none {
+  font-style: italic;
+  color: #999;
+}
+
 #head {
   padding: 0.4em 0.75em 0.2em 0.75em;
 }

Modified: mgmt/cumin/python/cumin/server.py
===================================================================
--- mgmt/cumin/python/cumin/server.py	2007-10-09 17:45:25 UTC (rev 983)
+++ mgmt/cumin/python/cumin/server.py	2007-10-09 17:58:20 UTC (rev 984)
@@ -84,6 +84,9 @@
 
         return mlink(branch.marshal(), "ServerGroup", group.name)
 
+    def render_none(self, session, group):
+        return none()
+
 class ServerView(Widget):
     def __init__(self, app, name):
         super(ServerView, self).__init__(app, name)

Modified: mgmt/cumin/python/cumin/widgets.py
===================================================================
--- mgmt/cumin/python/cumin/widgets.py	2007-10-09 17:45:25 UTC (rev 983)
+++ mgmt/cumin/python/cumin/widgets.py	2007-10-09 17:58:20 UTC (rev 984)
@@ -11,7 +11,7 @@
     return "<a href=\"%s\">%s</a>" % (href, name)
 
 def none():
-    return "<em>None</em>"
+    return "<span class=\"none\">None</span>"
 
 class CuminFrame(Frame, ModeSet):
     def do_process(self, session, object):

Modified: mgmt/cumin/python/wooly/widgets.py
===================================================================
--- mgmt/cumin/python/wooly/widgets.py	2007-10-09 17:45:25 UTC (rev 983)
+++ mgmt/cumin/python/wooly/widgets.py	2007-10-09 17:58:20 UTC (rev 984)
@@ -137,15 +137,24 @@
 
         if items:
             writer = Writer()
-            
+
             for item in items:
                 self.item_tmpl.render(session, item, writer)
 
-            return writer.to_string()
+            html = writer.to_string()
+        else:
+            html = self.render_none(session, object)
 
+        return html
+
     def render_item_content(self, session, item):
         return None
 
+    def render_none(self, session, object):
+        """For producing a message when the set is empty"""
+        
+        return None
+
 class ItemTree(ItemSet):
     def get_items(self, session, object):
         """Get the root items"""




More information about the rhmessaging-commits mailing list