| -rw-r--r-- | cgit.c | 4 | ||||
| -rw-r--r-- | cgit.css | 5 | ||||
| -rw-r--r-- | cgit.h | 4 | ||||
| -rw-r--r-- | html.c | 10 | ||||
| -rw-r--r-- | shared.c | 3 | ||||
| -rw-r--r-- | ui-repolist.c | 2 | ||||
| -rw-r--r-- | ui-shared.c | 28 |
7 files changed, 5 insertions, 51 deletions
@@ -16,7 +16,7 @@ static void cgit_print_repo_page(struct cacheitem *item) cgit_read_config("info/cgit", cgit_repo_config_cb)) { char *title = fmt("%s - %s", cgit_root_title, "Bad request"); cgit_print_docstart(title, item); - cgit_print_pageheader(title, 0); + cgit_print_pageheader(title); cgit_print_error(fmt("Unable to scan repository: %s", strerror(errno))); cgit_print_docend(); @@ -25,7 +25,7 @@ static void cgit_print_repo_page(struct cacheitem *item) setenv("GIT_DIR", fmt("%s/%s", cgit_root, cgit_query_repo), 1); char *title = fmt("%s - %s", cgit_repo_name, cgit_repo_desc); cgit_print_docstart(title, item); - cgit_print_pageheader(title, 0); + cgit_print_pageheader(title); if (!cgit_query_page) { cgit_print_summary(); } else if (!strcmp(cgit_query_page, "log")) { @@ -61,11 +61,6 @@ div#header { div#header img#logo { float: right; } - -div#header input { - float: right; - margin: 0.25em 1em; -} div#header a { color: black; } @@ -55,7 +55,6 @@ extern int cgit_query_has_sha1; extern char *cgit_querystring; extern char *cgit_query_repo; extern char *cgit_query_page; -extern char *cgit_query_search; extern char *cgit_query_head; extern char *cgit_query_sha1; extern char *cgit_query_sha2; @@ -76,7 +75,6 @@ extern void htmlf(const char *format,...); extern void html_txt(char *txt); extern void html_ntxt(int len, char *txt); extern void html_attr(char *txt); -extern void html_hidden(char *name, char *value); extern void html_link_open(char *url, char *title, char *class); extern void html_link_close(void); extern void html_filemode(unsigned short mode); @@ -100,7 +98,7 @@ extern void cgit_print_error(char *msg); extern void cgit_print_date(unsigned long secs); extern void cgit_print_docstart(char *title, struct cacheitem *item); extern void cgit_print_docend(); -extern void cgit_print_pageheader(char *title, int show_search); +extern void cgit_print_pageheader(char *title); extern void cgit_print_repolist(struct cacheitem *item); extern void cgit_print_summary(); @@ -117,15 +117,6 @@ void html_attr(char *txt) html(txt); } -void html_hidden(char *name, char *value) -{ - html("<input type='hidden' name='"); - html_attr(name); - html("' value='"); - html_attr(value); - html("'/>"); -} - void html_link_open(char *url, char *title, char *class) { html("<a href='"); @@ -164,4 +155,3 @@ void html_filemode(unsigned short mode) html_fileperm(mode >> 3); html_fileperm(mode); } - @@ -36,7 +36,6 @@ char *cgit_querystring = NULL; char *cgit_query_repo = NULL; char *cgit_query_page = NULL; char *cgit_query_head = NULL; -char *cgit_query_search = NULL; char *cgit_query_sha1 = NULL; char *cgit_query_sha2 = NULL; int cgit_query_ofs = 0; @@ -87,8 +86,6 @@ void cgit_querystring_cb(const char *name, const char *value) cgit_query_repo = xstrdup(value); } else if (!strcmp(name, "p")) { cgit_query_page = xstrdup(value); - } else if (!strcmp(name, "q")) { - cgit_query_search = xstrdup(value); } else if (!strcmp(name, "h")) { cgit_query_head = xstrdup(value); cgit_query_has_symref = 1; diff --git a/ui-repolist.c b/ui-repolist.c index 9f12b18..7090c12 100644 --- a/ui-repolist.c +++ b/ui-repolist.c @@ -17,7 +17,7 @@ void cgit_print_repolist(struct cacheitem *item) chdir(cgit_root); cgit_print_docstart(cgit_root_title, item); - cgit_print_pageheader(cgit_root_title, 0); + cgit_print_pageheader(cgit_root_title); if (!(d = opendir("."))) { cgit_print_error(fmt("Unable to scan repository directory: %s", diff --git a/ui-shared.c b/ui-shared.c index b9c1243..9ec4be8 100644 --- a/ui-shared.c +++ b/ui-shared.c @@ -60,18 +60,6 @@ char *cgit_pageurl(const char *reponame, const char *pagename, } } -char *cgit_currurl() -{ - if (!cgit_virtual_root) - return "./cgit.cgi"; - else if (cgit_query_page) - return fmt("%s/%s/%s/", cgit_virtual_root, cgit_query_repo, cgit_query_page); - else if (cgit_query_repo) - return fmt("%s/%s/", cgit_virtual_root, cgit_query_repo); - else - return fmt("%s/", cgit_virtual_root); -} - void cgit_print_date(unsigned long secs) { @@ -110,26 +98,12 @@ void cgit_print_docend() html("</body>\n</html>\n"); } -void cgit_print_pageheader(char *title, int show_search) +void cgit_print_pageheader(char *title) { html("<div id='header'>"); htmlf("<a href='%s'>", cgit_logo_link); htmlf("<img id='logo' src='%s'/>\n", cgit_logo); htmlf("</a>"); - if (show_search) { - html("<form method='get' href='"); - html_attr(cgit_currurl()); - html("'>"); - if (cgit_query_head) - html_hidden("h", cgit_query_head); - if (cgit_query_sha1) - html_hidden("id", cgit_query_sha1); - if (cgit_query_sha2) - html_hidden("id2", cgit_query_sha2); - html("<input type='text' name='q' value='"); - html_attr(cgit_query_search); - html("'/></form>"); - } if (cgit_query_repo) htmlf("<a href='%s'>", cgit_repourl(cgit_query_repo)); html_txt(title); |