[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

[PATCH] bapase.cgi -- output with tablesorter



Hi,

---
 web/bapase.cgi |   33 +++++++++++++++------------------
 1 file changed, 15 insertions(+), 18 deletions(-)

diff --git a/web/bapase.cgi b/web/bapase.cgi
index a07376e..ef22f9c 100755
--- a/web/bapase.cgi
+++ b/web/bapase.cgi
@@ -274,25 +274,22 @@ $actions = Actions::fetch
 
 puts <<-EOF
 <html><head>
-<style type="text/css">
-  td, th {
-    border: 1px solid gray;
-    padding-left: 2px;
-    padding-right: 2px;
-  }
-  th {
-    font-size: 8pt;
-  }
-  tr:hover  {
-    background-color: #ccc;
-  }
-  table {
-    border-collapse: collapse;
-  }
-</style>
+<link rel="stylesheet" href="" type="text/css" />
+<script type="text/_javascript_" src=""
+<script type="text/_javascript_" src=""
+<script type="text/_javascript_">
+    $(document).ready(function() {
+        // call the tablesorter plugin
+        $("table").tablesorter({
+            // sort on the first column and third column, order asc
+            // sortList: [[0,0],[2,0]]
+            sortList: [[0,0]]
+        });            
+    });
+</script>
 <title>Bapase</title>
 </head><body>
-<table border="1"><tr>
+<table class="tablesorter"><thead><tr>
 <th></th><th>Package</th><th>Action</th>
 EOF
 puts "<th>Orphaned</th>" if orphaned
@@ -304,7 +301,7 @@ puts <<-EOF
 <th>Last upload</th>
 <th>NMUs</th>
 <th>Comments</th>
-</tr>
+</tr></thead>
 EOF
 tqs = Time::now
 sth = dbh.prepare(query)
--

 Regrads, 
    Prach Pongpanich

Reply to: