Merge branch 'goibhniu' of git://git.pipapo.org/mob/webgit
authorChristian Thaeter <ct@pipapo.org>
Wed, 13 Feb 2008 06:30:13 +0000 (07:30 +0100)
committerChristian Thaeter <ct@pipapo.org>
Wed, 13 Feb 2008 06:30:13 +0000 (07:30 +0100)
* 'goibhniu' of git://git.pipapo.org/mob/webgit:
  Fixed sorttable, needed to add thead and tbody tags

Conflicts:

src/webgit.h

Some reindenting, cleanup

1  2 
src/actions.c
src/webgit.c
src/webgit.h

diff --cc src/actions.c
@@@ -114,66 -117,76 +115,75 @@@ webgit_main_content_action (struct webg
  
        if (n->age < n->maxage)
          {
-           html_list_append (table, html (
-                                          html_tag ("tr",
-                                                    html_attr ("class", (++row & 1) ? "odd" : "even")
+           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_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"),
-                                               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"),
++                                              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,
-                                                                        "path", ""
-                                                                        )
++                                                                       "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_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
diff --cc src/webgit.c
@@@ -340,16 -340,16 +340,14 @@@ main (int argc, char**argv
  #endif
  
  #ifdef ENABLE_SORTTABLE
-                                                   /*
-                                                     TODO fix this (goibhniu)
 -
 -
                                                      , html (
                                                            html_tag ("script",
--                                                                    html_attr ("src", 
++                                                                    html_attr ("src",
                                                                                 webgit_webskinpath (&query, "js/sorttable.js")
                                                                                 ),
                                                                      html_attr ("type", "text/javascript")
                                                                      )
-                                                                     ) */
 -                                                                    )
++                                                            )
  #endif
  
                                                    ),
diff --cc src/webgit.h
@@@ -24,8 -24,8 +24,8 @@@
  
  #include "llist.h"
  
 -#define ENABLE_CODEPRESS 1
 +//#define ENABLE_CODEPRESS 1
//#define ENABLE_SORTTABLE 1
+ #define ENABLE_SORTTABLE 1
  
  #define WEBGIT_CONFIG "./webgit.conf" /* TODO fix via configure --with-webgit-config=... */