Commits

okfn  committed 9109c8f

[wdmmg/wui/coins][s+]: more improvements including sort order etc.

  • Participants
  • Parent commits 351d3d8

Comments (0)

Files changed (3)

File wdmmg/wdmmg/config/routing.py

 
     # CUSTOM ROUTES HERE
 
-    map.connect('home', '/', controller='home', action='index')
+    # map.connect('home', '/', controller='home', action='index')
+    map.connect('home', '/', controller='coins', action='index')
     
     map.connect('/aggregate', controller='aggregate', action='view')
 

File wdmmg/wdmmg/controllers/coins.py

         self.db = connection[dbname]
 
     def index(self):
+        from pymongo import ASCENDING, DESCENDING
         c.items_per_page = 100
         c.q = request.params.get('q', None)
         page=int(request.params.get('page', 1))
             dbq = self.db.coins.find(
                     {'search_field':{'$all': c.q.split()}}
                     )
+            dbq.sort('value', DESCENDING)
         else:
             dbq = self.db.coins.find()
         c.results = [ x for x in

File wdmmg/wdmmg/templates/coins/entry.html

 
   <py:def function="page_title">COINS - Entry - ${c.entry.srcid}</py:def>
   <py:def function="optional_head">
+    <style type="text/css">
+      #sidebar { display: none; }
+      #content { width: 100%;
+        border-right: none;
+      }
+      #content table {
+        overflow:auto;
+      }
+    </style>
   </py:def>
   
   <div py:def="content">