summaryrefslogtreecommitdiffabout
path: root/ui-shared.c
Unidiff
Diffstat (limited to 'ui-shared.c') (more/less context) (ignore whitespace changes)
-rw-r--r--ui-shared.c9
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
@@ -396,44 +396,49 @@ void cgit_print_pageheader(char *title, int show_search)
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
428void cgit_print_snapshot_start(const char *mimetype, const char *filename, 433void 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: */