author | Lars Hjemli <hjemli@gmail.com> | 2007-10-28 14:23:00 (UTC) |
---|---|---|
committer | Lars Hjemli <hjemli@gmail.com> | 2007-10-28 14:23:00 (UTC) |
commit | 68ca032dbe7379f78775fb03ef34a9ad2abc409f (patch) (unidiff) | |
tree | 2209ae312eb932bc61b41ae9c774f6cfcc3dd372 /ui-shared.c | |
parent | 6ec5f36f279a85f59db2851ab476d9acd0015770 (diff) | |
download | cgit-68ca032dbe7379f78775fb03ef34a9ad2abc409f.zip cgit-68ca032dbe7379f78775fb03ef34a9ad2abc409f.tar.gz cgit-68ca032dbe7379f78775fb03ef34a9ad2abc409f.tar.bz2 |
Teach log search about --grep, --author and --committer
This makes the log searching more explicit, using a dropdown box to specify
the commit field to match against.
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
-rw-r--r-- | ui-shared.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/ui-shared.c b/ui-shared.c index e4bb98f..45105dc 100644 --- a/ui-shared.c +++ b/ui-shared.c | |||
@@ -356,84 +356,89 @@ void cgit_print_docstart(char *title, struct cacheitem *item) | |||
356 | html("</head>\n"); | 356 | html("</head>\n"); |
357 | html("<body>\n"); | 357 | html("<body>\n"); |
358 | } | 358 | } |
359 | 359 | ||
360 | void cgit_print_docend() | 360 | void cgit_print_docend() |
361 | { | 361 | { |
362 | html("</td></tr></table>"); | 362 | html("</td></tr></table>"); |
363 | html("</body>\n</html>\n"); | 363 | html("</body>\n</html>\n"); |
364 | } | 364 | } |
365 | 365 | ||
366 | void cgit_print_pageheader(char *title, int show_search) | 366 | void cgit_print_pageheader(char *title, int show_search) |
367 | { | 367 | { |
368 | html("<table id='layout'>"); | 368 | html("<table id='layout'>"); |
369 | html("<tr><td id='header'><a href='"); | 369 | html("<tr><td id='header'><a href='"); |
370 | html_attr(cgit_rooturl()); | 370 | html_attr(cgit_rooturl()); |
371 | html("'>"); | 371 | html("'>"); |
372 | html_txt(cgit_root_title); | 372 | html_txt(cgit_root_title); |
373 | html("</a></td><td id='logo'>"); | 373 | html("</a></td><td id='logo'>"); |
374 | html("<a href='"); | 374 | html("<a href='"); |
375 | html_attr(cgit_logo_link); | 375 | html_attr(cgit_logo_link); |
376 | htmlf("'><img src='%s' alt='logo'/></a>", cgit_logo); | 376 | htmlf("'><img src='%s' alt='logo'/></a>", cgit_logo); |
377 | html("</td></tr>"); | 377 | html("</td></tr>"); |
378 | html("<tr><td id='crumb'>"); | 378 | html("<tr><td id='crumb'>"); |
379 | if (cgit_query_repo) { | 379 | if (cgit_query_repo) { |
380 | html_txt(cgit_repo->name); | 380 | html_txt(cgit_repo->name); |
381 | html(" ("); | 381 | html(" ("); |
382 | html_txt(cgit_query_head); | 382 | html_txt(cgit_query_head); |
383 | html(") : "); | 383 | html(") : "); |
384 | reporevlink(NULL, "summary", NULL, NULL, cgit_query_head, | 384 | reporevlink(NULL, "summary", NULL, NULL, cgit_query_head, |
385 | NULL, NULL); | 385 | NULL, NULL); |
386 | html(" "); | 386 | html(" "); |
387 | cgit_log_link("log", NULL, NULL, cgit_query_head, | 387 | cgit_log_link("log", NULL, NULL, cgit_query_head, |
388 | cgit_query_sha1, cgit_query_path, 0); | 388 | cgit_query_sha1, cgit_query_path, 0); |
389 | html(" "); | 389 | html(" "); |
390 | cgit_tree_link("tree", NULL, NULL, cgit_query_head, | 390 | cgit_tree_link("tree", NULL, NULL, cgit_query_head, |
391 | cgit_query_sha1, NULL); | 391 | cgit_query_sha1, NULL); |
392 | html(" "); | 392 | html(" "); |
393 | cgit_commit_link("commit", NULL, NULL, cgit_query_head, | 393 | cgit_commit_link("commit", NULL, NULL, cgit_query_head, |
394 | cgit_query_sha1); | 394 | cgit_query_sha1); |
395 | html(" "); | 395 | html(" "); |
396 | cgit_diff_link("diff", NULL, NULL, cgit_query_head, | 396 | cgit_diff_link("diff", NULL, NULL, cgit_query_head, |
397 | cgit_query_sha1, cgit_query_sha2, | 397 | cgit_query_sha1, cgit_query_sha2, |
398 | cgit_query_path); | 398 | cgit_query_path); |
399 | } else { | 399 | } else { |
400 | html_txt("Index of repositories"); | 400 | html_txt("Index of repositories"); |
401 | } | 401 | } |
402 | html("</td>"); | 402 | html("</td>"); |
403 | html("<td id='search'>"); | 403 | html("<td id='search'>"); |
404 | if (show_search) { | 404 | if (show_search) { |
405 | html("<form method='get' action='"); | 405 | html("<form method='get' action='"); |
406 | html_attr(cgit_currurl()); | 406 | html_attr(cgit_currurl()); |
407 | html("'>"); | 407 | html("'>"); |
408 | if (!cgit_virtual_root) { | 408 | if (!cgit_virtual_root) { |
409 | if (cgit_query_repo) | 409 | if (cgit_query_repo) |
410 | html_hidden("r", cgit_query_repo); | 410 | html_hidden("r", cgit_query_repo); |
411 | if (cgit_query_page) | 411 | if (cgit_query_page) |
412 | html_hidden("p", cgit_query_page); | 412 | html_hidden("p", cgit_query_page); |
413 | } | 413 | } |
414 | if (cgit_query_head) | 414 | if (cgit_query_head) |
415 | html_hidden("h", cgit_query_head); | 415 | html_hidden("h", cgit_query_head); |
416 | if (cgit_query_sha1) | 416 | if (cgit_query_sha1) |
417 | html_hidden("id", cgit_query_sha1); | 417 | html_hidden("id", cgit_query_sha1); |
418 | if (cgit_query_sha2) | 418 | if (cgit_query_sha2) |
419 | html_hidden("id2", cgit_query_sha2); | 419 | html_hidden("id2", cgit_query_sha2); |
420 | html("<input type='text' name='q' value='"); | 420 | html("<select name='qt'>"); |
421 | html_option("grep", "log msg", cgit_query_grep); | ||
422 | html_option("author", "author", cgit_query_grep); | ||
423 | html_option("committer", "committer", cgit_query_grep); | ||
424 | html("</select>"); | ||
425 | html("<input class='txt' type='text' name='q' value='"); | ||
421 | html_attr(cgit_query_search); | 426 | html_attr(cgit_query_search); |
422 | html("'/></form>"); | 427 | html("'/><input class='btn' type='submit' value='...'/></form>"); |
423 | } | 428 | } |
424 | html("</td></tr>"); | 429 | html("</td></tr>"); |
425 | html("<tr><td id='content' colspan='2'>"); | 430 | html("<tr><td id='content' colspan='2'>"); |
426 | } | 431 | } |
427 | 432 | ||
428 | void cgit_print_snapshot_start(const char *mimetype, const char *filename, | 433 | void cgit_print_snapshot_start(const char *mimetype, const char *filename, |
429 | struct cacheitem *item) | 434 | struct cacheitem *item) |
430 | { | 435 | { |
431 | htmlf("Content-Type: %s\n", mimetype); | 436 | htmlf("Content-Type: %s\n", mimetype); |
432 | htmlf("Content-Disposition: inline; filename=\"%s\"\n", filename); | 437 | htmlf("Content-Disposition: inline; filename=\"%s\"\n", filename); |
433 | htmlf("Last-Modified: %s\n", http_date(item->st.st_mtime)); | 438 | htmlf("Last-Modified: %s\n", http_date(item->st.st_mtime)); |
434 | htmlf("Expires: %s\n", http_date(item->st.st_mtime + | 439 | htmlf("Expires: %s\n", http_date(item->st.st_mtime + |
435 | ttl_seconds(item->ttl))); | 440 | ttl_seconds(item->ttl))); |
436 | html("\n"); | 441 | html("\n"); |
437 | } | 442 | } |
438 | 443 | ||
439 | /* vim:set sw=8: */ | 444 | /* vim:set sw=8: */ |