Fixed sorttable, needed to add thead and tbody tags
authorCillian de Roiste <cillian.deroiste@gmail.com>
Sun, 10 Feb 2008 14:25:26 +0000 (14:25 +0000)
committerCillian de Roiste <cillian.deroiste@gmail.com>
Sun, 10 Feb 2008 16:48:40 +0000 (16:48 +0000)
skins/default/css/webgit.css
src/actions.c
src/webgit.c
src/webgit.h

index 7840543..36845e8 100644 (file)
@@ -122,7 +122,7 @@ a {
 /* table row classes  */
 
 .even {
-  background-color: #f6f6f6;
+  background-color: #e6e6e6;
 }
 
 .odd {
index 83eefe1..90e893a 100644 (file)
@@ -87,9 +87,10 @@ webgit_main_menu_action (struct webgit_query* query)
 static Html
 webgit_main_content_action (struct webgit_query* query)
 {
-  Html table = html_list ();
+  Html table_head = html_list ();
+  Html table_body = html_list ();
 
-  html_list_append (table, html(
+  html_list_append (table_head, html(
                           html(html_tag ("tr"),
                                html(html_tag ("th"),"Name"),
                                html(html_tag ("th"),"Git URL"),
@@ -106,6 +107,8 @@ webgit_main_content_action (struct webgit_query* query)
 
   int row = 0;
 
+
+
   LLIST_FOREACH (&query->repos, node)
     {
       struct webgit_repo_info* n = (struct webgit_repo_info*)node;
@@ -114,66 +117,76 @@ webgit_main_content_action (struct webgit_query* query)
 
       if (n->age < n->maxage)
         {
-          html_list_append (table, html (
-                                         html_tag ("tr",
-                                                   html_attr ("class", (++row & 1) ? "odd" : "even")
-                                                   ),
-                                         html(html_tag ("td"),
-                                              webgit_summary_link (query, n, html (n->name))),
-                                         html(html_tag ("td"), n->url ?
-                                              html (
-                                                    html_tag ("a", html_attr ("href", n->url)),
-                                                    n->url)
-                                              : html("N/A")
-                                              ),
-                                         html(html_tag ("td"), n->description),
-                                         html(html_tag ("td"), n->owner),
-                                         html(html_tag ("td"),
-                                              webgit_object_link (query, webgit_pretty_age (n->age),
-                                                                  "repo", n->name,
-                                                                  "ref", n->last_head,
-                                                                  "commit", n->last_commit)
-                                              ),
-                                         html(html_tag ("td"),
-                                              webgit_email_link (
-                                                                 html (n->last_author_name),
-                                                                 html (n->last_author_email)
-                                                                 )
-                                              ),
-                                         html(html_tag ("td"),
-                                              webgit_email_link (
-                                                                 html (n->last_committer_name),
-                                                                 html (n->last_committer_email)
-                                                                 )
-                                              ),
-                                         html(html_tag ("td"),
-                                              html(
-                                                   webgit_log_link (query,
-                                                                    n->name,
-                                                                    n->last_head,
-                                                                    NULL, 0,
-                                                                    query->count,
-                                                                    html("Log")
-                                                                    ),
-                                                   " ",
-                                                   "Diff ",
-                                                   //webgit_diff_link (query, n, n->last_head, html("Diff")),
-                                                   //" ",
-                                                   webgit_object_link (query, html("Tree"),
-                                                                       "repo", n->name,
-                                                                       "ref", n->last_head,
-                                                                       "commit", n->last_commit,
-                                                                       "path", ""
-                                                                       )
-                                                   )
-                                              )
+          html_list_append (table_body, html (
+
+                                                                     html_tag ("tr",
+                                                                               html_attr ("class", (++row & 1) ? "odd" : "even")
+                                                                               ),
+                                                                     html(html_tag ("td"),
+                                                                          webgit_summary_link (query, n, html (n->name))),
+                                                                     html(html_tag ("td"), n->url ?
+                                                                          html (
+                                                                                html_tag ("a", html_attr ("href", n->url)),
+                                                                                n->url)
+                                                                          : html("N/A")
+                                                                          ),
+                                                                     html(html_tag ("td"), n->description),
+                                                                     html(html_tag ("td"), n->owner),
+                                                                     html(html_tag ("td"),
+                                                                          webgit_object_link (query, webgit_pretty_age (n->age),
+                                                                                              "repo", n->name,
+                                                                                              "ref", n->last_head,
+                                                                                              "commit", n->last_commit)
+                                                                          ),
+                                                                     html(html_tag ("td"),
+                                                                          webgit_email_link (
+                                                                                             html (n->last_author_name),
+                                                                                             html (n->last_author_email)
+                                                                                             )
+                                                                          ),
+                                                                     html(html_tag ("td"),
+                                                                          webgit_email_link (
+                                                                                             html (n->last_committer_name),
+                                                                                             html (n->last_committer_email)
+                                                                                             )
+                                                                          ),
+
+
+                                                                     html(html_tag ("td"),
+                                                                          html(
+                                                                               webgit_log_link (query,
+                                                                                                n->name,
+                                                                                                n->last_head,
+                                                                                                NULL, 0,
+                                                                                                query->count,
+                                                                                                html("Log")
+                                                                                                ),
+                                                                               " ",
+                                                                               "Diff ",
+                                                                               //webgit_diff_link (query, n, n->last_head, html("Diff")),
+                                                                               //" ",
+                                                                               webgit_object_link (query, html("Tree"),
+                                                                                                   "repo", n->name,
+                                                                                                   "ref", n->last_head,
+                                                                                                   "commit", n->last_commit,
+                                                                                                   "path", ""
+                                                                                                   )
+                                                                               )
+                                                                          )
+
                                          ),
                             html_nl()
                             );
         }
     }
 
-  return html (html_tag ("table", html_attr ("id", "summary"), html_attr ("class", "sortable"), html_attr ("cellpadding", "0"), html_attr ("cellspacing", "0")), table);
+/*   html_list_append (html (html_tag ("blather"), table)); */
+
+  return html (
+               html_tag ("table", html_attr ("id", "summary"), html_attr ("class", "sortable"), html_attr ("cellpadding", "0"), html_attr ("cellspacing", "0")),
+               html( html_tag("thead"), table_head),
+               html( html_tag("tbody"), table_body)
+               );
 }
 
 static Html
index b4c8901..92da820 100644 (file)
@@ -340,8 +340,8 @@ main (int argc, char**argv)
 #endif
 
 #ifdef ENABLE_SORTTABLE
-                                                  /*
-                                                    TODO fix this (goibhniu)
+
+
                                                     , html (
                                                           html_tag ("script",
                                                                     html_attr ("src", 
@@ -349,7 +349,7 @@ main (int argc, char**argv)
                                                                                ),
                                                                     html_attr ("type", "text/javascript")
                                                                     )
-                                                                    ) */
+                                                                    )
 #endif
 
                                                   ),
index 562c05b..a03cb7a 100644 (file)
@@ -25,7 +25,7 @@
 #include "llist.h"
 
 #define ENABLE_CODEPRESS 1
-//#define ENABLE_SORTTABLE 1
+#define ENABLE_SORTTABLE 1
 
 #define WEBGIT_CONFIG "./webgit.conf" /* TODO fix via configure --with-webgit-config=... */