let summary headers link to to the respective subpages
[webgit] / src / actions.c
index f54fa4a..4242ecb 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 />"
                );
 }
 
@@ -236,7 +264,12 @@ webgit_summary_content_action (struct webgit_repo_info* repo)
   /* log */
   html_list_append (content,
                     html (
-                          html (html_tag ("h2"), "Log of branch '", repo->last_head, "'"),
+                          html (html_tag ("h2"),
+                                webgit_log_link (repo->query, repo->name, repo->last_head,
+                                                 NULL, 0, repo->query->count,
+                                                 html ("Log of branch '", repo->last_head, "'")
+                                                 )
+                                ),
                           webgit_log_table (repo->query, repo->last_head, 5 /*TODO: config this*/, 0))
                     );
 
@@ -244,7 +277,11 @@ webgit_summary_content_action (struct webgit_repo_info* repo)
   /* branches */
   html_list_append (content,
                     html (
-                          html (html_tag ("h2"), "Branches"),
+                          html (html_tag ("h2"),
+                                webgit_branch_link (repo, NULL, repo->query->count,
+                                                    html ("Branches")
+                                                    )
+                                ),
                           webgit_branch_table (repo, NULL, 5 /*TODO: config this*/)
                           )
                     );
@@ -252,7 +289,11 @@ webgit_summary_content_action (struct webgit_repo_info* repo)
   /* tags */
   html_list_append (content,
                     html (
-                          html (html_tag ("h2"), "Tags"),
+                          html (html_tag ("h2"),
+                                webgit_tag_link (repo, NULL, repo->query->count,
+                                                 html ("Tags")
+                                                 )
+                                ),
                           webgit_tag_table (repo, NULL, 5 /*TODO: config this*/)
                           )
                     );
@@ -269,7 +310,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 ()
               );
 }