-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
@@ -96,3 +96,3 @@ static void cgit_print_repo_page(struct cacheitem *item) 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); @@ -146,2 +146,10 @@ td#search form { +td#search select { + font-size: 9pt; + padding: 0px; + border: solid 1px #333; + color: #333; + background-color: #fff; +} + td#search input { @@ -149,3 +157,6 @@ td#search input { padding: 0px; - width: 10em; +} + +td#search input.txt { + width: 8em; border: solid 1px #333; @@ -155,2 +166,8 @@ td#search input { +td#search input.btn { + border: solid 1px #333; + color: #333; + background-color: #ccc; +} + div#summary { @@ -160,2 +160,3 @@ extern char *cgit_query_page; extern char *cgit_query_search; +extern char *cgit_query_grep; extern char *cgit_query_head; @@ -262,3 +263,4 @@ 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); @@ -56,2 +56,3 @@ char *cgit_query_head = NULL; char *cgit_query_search = NULL; +char *cgit_query_grep = NULL; char *cgit_query_sha1 = NULL; @@ -234,2 +235,4 @@ void cgit_querystring_cb(const char *name, const char *value) cgit_parse_url(value); + } else if (!strcmp(name, "qt")) { + cgit_query_grep = xstrdup(value); } else if (!strcmp(name, "q")) { @@ -53,3 +53,3 @@ 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) { @@ -64,4 +64,7 @@ void cgit_print_log(const char *tip, int ofs, int cnt, char *grep, char *path, i - 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) { diff --git a/ui-shared.c b/ui-shared.c index e4bb98f..45105dc 100644 --- a/ui-shared.c +++ b/ui-shared.c @@ -419,5 +419,10 @@ void cgit_print_pageheader(char *title, int show_search) 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>"); } diff --git a/ui-summary.c b/ui-summary.c index 178e959..04a466a 100644 --- a/ui-summary.c +++ b/ui-summary.c @@ -238,3 +238,3 @@ void cgit_print_summary() 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'>"); |