]> gitweb.ps.run Git - ps-cgit/blobdiff - ui-shared.c
Add search parameters to cgit_log_link
[ps-cgit] / ui-shared.c
index 1d6694041baac51f214477a803a8c9360fe31347..a03661ac987d72d799e8e5cdfb94a19ac8864f8b 100644 (file)
@@ -194,7 +194,7 @@ void cgit_tree_link(char *name, char *title, char *class, char *head,
 }
 
 void cgit_log_link(char *name, char *title, char *class, char *head,
-                  char *rev, char *path, int ofs)
+                  char *rev, char *path, int ofs, char *grep, char *pattern)
 {
        char *delim;
 
@@ -205,6 +205,15 @@ void cgit_log_link(char *name, char *title, char *class, char *head,
                html_attr(rev);
                delim = "&";
        }
+       if (grep && pattern) {
+               html(delim);
+               html("qt=");
+               html_attr(grep);
+               delim = "&";
+               html(delim);
+               html("q=");
+               html_attr(pattern);
+       }
        if (ofs > 0) {
                html(delim);
                html("ofs=");
@@ -461,7 +470,7 @@ void cgit_print_pageheader(char *title, int show_search)
                reporevlink(NULL, "summary", NULL, "menu", cgit_query_head,
                            NULL, NULL);
                cgit_log_link("log", NULL, "menu", cgit_query_head,
-                             cgit_query_sha1, cgit_query_path, 0);
+                             cgit_query_sha1, cgit_query_path, 0, NULL, NULL);
                cgit_tree_link("tree", NULL, "menu", cgit_query_head,
                               cgit_query_sha1, NULL);
                cgit_commit_link("commit", NULL, "menu", cgit_query_head,