few more parameters for webgit_log_link
authorChristian Thaeter <ct@pipapo.org>
Tue, 15 Jan 2008 10:08:28 +0000 (11:08 +0100)
committerChristian Thaeter <ct@pipapo.org>
Tue, 15 Jan 2008 10:08:28 +0000 (11:08 +0100)
src/actions.c
src/log.c
src/log.h

index e76e791..cbb67cc 100644 (file)
@@ -95,7 +95,13 @@ webgit_main_content_action (struct webgit_query* query)
                                           ),
                                      html(html_tag ("td"),
                                           html(
-                                               webgit_log_link (query, n, n->last_head, html("Log")),
+                                               webgit_log_link (query,
+                                                                n->name,
+                                                                n->last_head,
+                                                                NULL, 0,
+                                                                query->count,
+                                                                html("Log")
+                                                                ),
                                                " ",
 
                                                "Diff ",
index 8035e67..2a89f20 100644 (file)
--- a/src/log.c
+++ b/src/log.c
 #include "log.h"
 
 Html
-webgit_log_link (struct webgit_query* query, struct webgit_repo_info* n, const char* head, Html text)
+webgit_log_link (struct webgit_query* query,
+                 const char* repo,
+                 const char* head,
+                 const char* object, int object_len,
+                 int count,
+                 Html text)
 {
   return html (
                html_tag ("a",
-                         html_attr ("href", html_fmt ("%s?repo=%s&action=log&head=%s",
-                                                      query->request->script_name,
-                                                      n->name,
-                                                      head?head:"master")
+                         html_attr ("href", html(
+                                                 html_fmt ("%s?repo=%s&action=log&head=%s",
+                                                           query->request->script_name,
+                                                           repo,
+                                                           head?head:"master"),
+                                                 object ? html_fmt("&object=%.*s",
+                                                                   object_len, object)
+                                                 : "",
+                                                 count > 0 ? html_fmt("&count=%d",
+                                                                      count)
+                                                 : ""
+                                                 )
                                     )
                          ),
                text
index cb3a2c5..3555e8d 100644 (file)
--- a/src/log.h
+++ b/src/log.h
 #include "webgit.h"
 
 Html
-webgit_log_link (struct webgit_query* query, struct webgit_repo_info* n, const char* head, Html text);
+webgit_log_link (struct webgit_query* query,
+                 const char* repo,
+                 const char* head,
+                 const char* object, int object_len,
+                 int count,
+                 Html text);
 
 #endif