Deryck Hodge has proposed merging lp:~deryck/launchpad/orderbybar-setup into 
lp:launchpad with lp:~abentley/launchpad/navigate-batches as a prerequisite.

Requested reviews:
  Launchpad code reviewers (launchpad-reviewers)
Related bugs:
  Bug #883237 in Launchpad itself: "OrderByBar should be integrated into new 
CustomBugListings  work"
  https://bugs.launchpad.net/launchpad/+bug/883237

For more details, see:
https://code.launchpad.net/~deryck/launchpad/orderbybar-setup/+merge/80708

This branch adds the OrderByBar to bug listings for the CustomBugListings 
feature.  It's not very smart at present and just adds the basic ordering 
buttons that will work for any context.  There are also some CSS rules I need 
to add to get the page looking better with the bar added, but this is all 
guarded by a feature flag.
-- 
https://code.launchpad.net/~deryck/launchpad/orderbybar-setup/+merge/80708
Your team Launchpad code reviewers is requested to review the proposed merge of 
lp:~deryck/launchpad/orderbybar-setup into lp:launchpad.
=== modified file 'lib/lp/bugs/templates/buglisting-default.pt'
--- lib/lp/bugs/templates/buglisting-default.pt	2011-10-28 19:28:33 +0000
+++ lib/lp/bugs/templates/buglisting-default.pt	2011-10-28 19:28:33 +0000
@@ -19,11 +19,27 @@
     <script type="text/javascript"
       tal:condition="not: view/shouldShowAdvancedForm">
     LPS.use('lp.registry.structural_subscription', 'lp.bugs.buglisting',
-            function(Y) {
+            'lp.ordering', function(Y) {
         Y.on('domready', function() {
             Y.lp.registry.structural_subscription.setup(
                 {content_box: "#structural-subscription-content-box"});
             var navigator = Y.lp.bugs.buglisting.ListingNavigator.from_page();
+            var orderby = new Y.lp.ordering.OrderByBar({
+                srcNode: Y.one('#bugs-orderby'),
+                sort_keys: [
+                    ['id', 'Bug number'],
+                    ['title', 'Bug title'],
+                    ['importance', 'Importance'],
+                    ['status', 'Status'],
+                    ['heat', 'Bug heat']
+                ],
+                active: 'importance',
+                sort_order: 'desc'
+            });
+            orderby.render();
+            Y.on('orderbybar:sort', function(e) {
+                navigator.first_batch(e);
+            });
         });
     });
   </script>

=== modified file 'lib/lp/bugs/templates/bugs-listing-table.pt'
--- lib/lp/bugs/templates/bugs-listing-table.pt	2011-10-28 19:28:33 +0000
+++ lib/lp/bugs/templates/bugs-listing-table.pt	2011-10-28 19:28:33 +0000
@@ -22,6 +22,7 @@
     />
     <tal:mustache
         condition="request/features/bugs.dynamic_bug_listings.enabled">
+        <div id="bugs-orderby"></div>
         <span id="client-listing" tal:content="structure context/mustache" />
         <script tal:content="structure context/mustache_listings" />
     </tal:mustache>

_______________________________________________
Mailing list: https://launchpad.net/~launchpad-reviewers
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~launchpad-reviewers
More help   : https://help.launchpad.net/ListHelp

Reply via email to