WIP: mainpage list of repositories
authorChristian Thaeter <ct@pipapo.org>
Sun, 16 Dec 2007 21:31:22 +0000 (22:31 +0100)
committerChristian Thaeter <ct@pipapo.org>
Sun, 16 Dec 2007 21:31:22 +0000 (22:31 +0100)
src/actions.c

index 477a099..13c27aa 100644 (file)
 
 #include "cwa.h"
 
+Html
+ctgit_summary_link (struct ctgit_query* query, struct ctgit_repo_info* n)
+{
+  return html (
+               html_tag ("a",
+                         html_attr ("href", html_fmt ("%s?repo=%s&action=summary",
+                                                      query->request->script_name,
+                                                      n->name)
+                                    )
+                         ),
+               n->name
+               );
+}
+
 
 static Html
 ctgit_main_action (struct ctgit_query* query)
 {
-  return html("main");
+  Html ret = html();
+
+  LLIST_FOREACH (&query->repos, node)
+    {
+      struct ctgit_repo_info* n = (struct ctgit_repo_info*)node;
+
+      //fprintf(stderr,"repo %s\n", n->name);
+
+      html_append (ret, html( ctgit_summary_link (query, n), html_nl()));
+    }
+
+
+  return html (ret, html_nl ());
 }
 
 static Html