Summary menu
authorChristian Thaeter <ct@pipapo.org>
Thu, 24 Jan 2008 18:56:16 +0000 (19:56 +0100)
committerChristian Thaeter <ct@pipapo.org>
Thu, 24 Jan 2008 18:56:16 +0000 (19:56 +0100)
 * logo and link
 * readme.html
 * link to repository configuration
 * back to main page

src/actions.c

index f54fa4a..271df52 100644 (file)
@@ -173,12 +173,40 @@ webgit_main_action (struct webgit_query* query)
 static Html
 webgit_summary_menu_action (struct webgit_repo_info* repo)
 {
-  (void) repo;
   return html (html_tag ("div"),
-               "Webgit or project logo<br />",
-               "Readme_menu.html <br />",
-               "Project administration <br />",
-               "link to main page <br />"
+               repo->logo ?
+               html (
+                     html_tag ("a",
+                               html_attr ("href", repo->logolink ? repo->logolink : "/")),
+                     html (
+                           html_tag ("img",
+                                     html_attr ("src", repo->logo),
+                                     html_attr ("alt", html (repo->name,"-logo"))
+                                     )
+                           )
+                     )
+               : html (
+                       html_tag ("img",
+                                 html_attr ("src", webgit_webskinpath (repo->query, "icons/webgit_logo.png")),
+                                 html_attr ("alt", "Webgit-Logo")
+                                 )
+                       ), "<br />",
+               repo->readme ? html_include (repo->readme) : html (), "<br />",
+               html (
+                     html_tag ("a",
+                               html_attr ("href", html_fmt ("%s?repo=%s&action=config",
+                                                            repo->query->request->script_name,
+                                                            repo->name)
+                                          )
+                               ),
+                     "Configure"
+                     ),"<br />",
+               html (
+                     html_tag ("a",
+                               html_attr ("href", repo->query->request->script_name)
+                               ),
+                     "Main Page"
+                     ),"<br />"
                );
 }
 
@@ -269,7 +297,7 @@ webgit_summary_action (struct webgit_query* query)
   webgit_repoinfo_find_last (repo);
 
   return html(
-              html(html_tag("div"), webgit_summary_menu_action (repo)), html_nl (),
+              html(html_tag("div", html_attr("id", "sub-menu")), webgit_summary_menu_action (repo)), html_nl (),
               html(html_tag("div", html_attr("id", "content")), webgit_summary_content_action (repo)), html_nl ()
               );
 }