Author: jmorliaguet
Date: Sun Feb  5 23:34:26 2006
New Revision: 2306

Modified:
   
cpsskins/branches/jmo-perspectives/ui/framework/tests/zope3/functional/aggregator/browser.py
   
cpsskins/branches/jmo-perspectives/ui/framework/tests/zope3/functional/aggregator/cpsskins_aggregator.pt
Log:

- added some data info to show when the feed was last updated.

- feedds are refreshed every 5 seconds



Modified: 
cpsskins/branches/jmo-perspectives/ui/framework/tests/zope3/functional/aggregator/browser.py
==============================================================================
--- 
cpsskins/branches/jmo-perspectives/ui/framework/tests/zope3/functional/aggregator/browser.py
        (original)
+++ 
cpsskins/branches/jmo-perspectives/ui/framework/tests/zope3/functional/aggregator/browser.py
        Sun Feb  5 23:34:26 2006
@@ -42,7 +42,6 @@
 
     def getFeed(self, id=1):
         time.sleep(1)
-
         data = {id: {
             'text': feeds_data[id],
             'updated': time.strftime("%a, %d %b %Y %H:%M:%S", time.gmtime())

Modified: 
cpsskins/branches/jmo-perspectives/ui/framework/tests/zope3/functional/aggregator/cpsskins_aggregator.pt
==============================================================================
--- 
cpsskins/branches/jmo-perspectives/ui/framework/tests/zope3/functional/aggregator/cpsskins_aggregator.pt
    (original)
+++ 
cpsskins/branches/jmo-perspectives/ui/framework/tests/zope3/functional/aggregator/cpsskins_aggregator.pt
    Sun Feb  5 23:34:26 2006
@@ -16,12 +16,19 @@
 
   <style type="text/css">
   .feedbox {
-    border: 1px solid red;
-    padding: 1em;
+    padding: 0.6em;
     margin: 0.4em;
-    background-color: #fdc;
+    background-color: #efc;
+    font-size: 1.2em;
+  }
+  .date {
+    background-color: #ffc;
+    border: 1px solid #fc0;
+    padding: 0.2em;
+    margin: 0.3em;
+    font-weight: bold;
+    width: 200px;
   }
-
   </style>
 
   <script type="text/javascript">
@@ -48,16 +55,23 @@
 
         $R(1, 6).each(function(feed) {
           var info = data[feed];
-          widget.appendChild(
-            Canvas.createNode({
+
+          var box = Canvas.createNode({
               tag: "div",
               classes: "feedbox",
-              text: feed + ": " + info.text +
-                    " [updated: " + info.updated + "]"
+              text: feed + ": " + (info.text || 'fetching data ...')
+          });
+
+          box.appendChild(
+            Canvas.createNode({
+              tag: "p",
+              classes: "date",
+              text: info.updated || ''
           }));
-        });
 
-      },
+          widget.appendChild(box);
+        });
+      }
 
     });
 
@@ -70,6 +84,7 @@
 
   <div id="area0">
 
+    <!-- models -->
     <ins class="model"
          tal:repeat="id python: range(1, 7)"
          tal:attributes="cite string:@@citeFeed?id=$id">
@@ -87,10 +102,12 @@
      },
      "storage": {
        "type": "compound",
+       "refresh": 5,
        "partitions": ["feed1", "feed2", "feed3", "feed4", "feed5", "feed6"]
     }}
     </ins>
 
+    <!-- views -->
     <ins class="view">
     {"widget": {
       "type": "feedbox"
-- 
http://lists.nuxeo.com/mailman/listinfo/z3lab-checkins

Reply via email to