[Bps-public-commit] r17218 - sd/trunk/lib/App/SD/Server

jesse at bestpractical.com jesse at bestpractical.com
Sat Dec 13 16:46:59 EST 2008


Author: jesse
Date: Sat Dec 13 16:46:59 2008
New Revision: 17218

Modified:
   sd/trunk/lib/App/SD/Server/View.pm

Log:
* sortable tables of issues

Modified: sd/trunk/lib/App/SD/Server/View.pm
==============================================================================
--- sd/trunk/lib/App/SD/Server/View.pm	(original)
+++ sd/trunk/lib/App/SD/Server/View.pm	Sat Dec 13 16:46:59 2008
@@ -155,28 +155,39 @@
 };
 
 private template 'issue_list' => sub {
-    my $self = shift;
+    my $self   = shift;
     my $issues = shift;
-    div {
-        class is 'issue_list';
-        
+    my $id = substr(rand(10),2); # hack  to get a unique id
+    table {
+        { class is 'tablesorter'; id is $id; };
+        thead {     
+            row {
+            th { 'id'};
+            th {'Status'};
+            th {'Summary'};
+            th {'Created'};
+            }
+        };
+        tbody {
         for my $issue (@$issues) {
-            ul {
-
-                li {
+            row {
 
-                    issue_link( $issue => $issue->luid );
-                    span { class is 'status';  $issue->prop('status') };
-                    span { class is 'summary'; $issue->prop('summary') };
-                    span { class is 'created'; $issue->prop('created') };
+                cell { issue_link( $issue => $issue->luid );};
+                cell{ class is 'status';  $issue->prop('status') };
+                cell { class is 'summary'; $issue->prop('summary') };
+                cell { class is 'created'; $issue->prop('created') };
 
                 }
 
             }
-
+        };
+        };
+         script {outs_raw(qq{
+            \$(document).ready(function() { \$("#@{[$id]}").tablesorter(); } ); 
+        });
         }
-    }
-};
+        
+        };
 
 template 'show_issue' => page {
         my $self = shift;



More information about the Bps-public-commit mailing list