-rw-r--r-- | cgit.c | 2 | ||||
-rw-r--r-- | cgit.css | 19 | ||||
-rw-r--r-- | cgit.h | 4 | ||||
-rw-r--r-- | shared.c | 3 | ||||
-rw-r--r-- | ui-log.c | 9 | ||||
-rw-r--r-- | ui-shared.c | 9 | ||||
-rw-r--r-- | ui-summary.c | 2 |
7 files changed, 39 insertions, 9 deletions
@@ -95,5 +95,5 @@ static void cgit_print_repo_page(struct cacheitem *item) case CMD_LOG: cgit_print_log(cgit_query_sha1, cgit_query_ofs, - cgit_max_commit_count, cgit_query_search, + cgit_max_commit_count, cgit_query_grep, cgit_query_search, cgit_query_path, 1); break; @@ -145,8 +145,19 @@ td#search form { } +td#search select { + font-size: 9pt; + padding: 0px; + border: solid 1px #333; + color: #333; + background-color: #fff; +} + td#search input { font-size: 9pt; padding: 0px; - width: 10em; +} + +td#search input.txt { + width: 8em; border: solid 1px #333; color: #333; @@ -154,4 +165,10 @@ td#search input { } +td#search input.btn { + border: solid 1px #333; + color: #333; + background-color: #ccc; +} + div#summary { vertical-align: top; @@ -159,4 +159,5 @@ extern char *cgit_query_repo; extern char *cgit_query_page; extern char *cgit_query_search; +extern char *cgit_query_grep; extern char *cgit_query_head; extern char *cgit_query_sha1; @@ -261,5 +262,6 @@ extern void cgit_print_tags(int maxcount); extern void cgit_print_repolist(struct cacheitem *item); extern void cgit_print_summary(); -extern void cgit_print_log(const char *tip, int ofs, int cnt, char *grep, char *path, int pager); +extern void cgit_print_log(const char *tip, int ofs, int cnt, char *grep, + char *pattern, char *path, int pager); extern void cgit_print_blob(struct cacheitem *item, const char *hex, char *path); extern void cgit_print_tree(const char *rev, char *path); @@ -55,4 +55,5 @@ char *cgit_query_page = NULL; char *cgit_query_head = NULL; char *cgit_query_search = NULL; +char *cgit_query_grep = NULL; char *cgit_query_sha1 = NULL; char *cgit_query_sha2 = NULL; @@ -233,4 +234,6 @@ void cgit_querystring_cb(const char *name, const char *value) } else if (!strcmp(name, "url")) { cgit_parse_url(value); + } else if (!strcmp(name, "qt")) { + cgit_query_grep = xstrdup(value); } else if (!strcmp(name, "q")) { cgit_query_search = xstrdup(value); @@ -52,5 +52,5 @@ void print_commit(struct commit *commit) -void cgit_print_log(const char *tip, int ofs, int cnt, char *grep, char *path, int pager) +void cgit_print_log(const char *tip, int ofs, int cnt, char *grep, char *pattern, char *path, int pager) { struct rev_info rev; @@ -63,6 +63,9 @@ void cgit_print_log(const char *tip, int ofs, int cnt, char *grep, char *path, i argv[1] = cgit_query_head; - if (grep) - argv[argc++] = fmt("--grep=%s", grep); + if (grep && pattern && (!strcmp(grep, "grep") || + !strcmp(grep, "author") || + !strcmp(grep, "committer"))) + argv[argc++] = fmt("--%s=%s", grep, pattern); + if (path) { argv[argc++] = "--"; diff --git a/ui-shared.c b/ui-shared.c index e4bb98f..45105dc 100644 --- a/ui-shared.c +++ b/ui-shared.c @@ -418,7 +418,12 @@ void cgit_print_pageheader(char *title, int show_search) if (cgit_query_sha2) html_hidden("id2", cgit_query_sha2); - html("<input type='text' name='q' value='"); + html("<select name='qt'>"); + html_option("grep", "log msg", cgit_query_grep); + html_option("author", "author", cgit_query_grep); + html_option("committer", "committer", cgit_query_grep); + html("</select>"); + html("<input class='txt' type='text' name='q' value='"); html_attr(cgit_query_search); - html("'/></form>"); + html("'/><input class='btn' type='submit' value='...'/></form>"); } html("</td></tr>"); diff --git a/ui-summary.c b/ui-summary.c index 178e959..04a466a 100644 --- a/ui-summary.c +++ b/ui-summary.c @@ -237,5 +237,5 @@ void cgit_print_summary() html("</div>"); if (cgit_summary_log > 0) - cgit_print_log(cgit_query_head, 0, cgit_summary_log, NULL, NULL, 0); + cgit_print_log(cgit_query_head, 0, cgit_summary_log, NULL, NULL, NULL, 0); html("<table class='list nowrap'>"); if (cgit_summary_log > 0) |