-rw-r--r-- | cgit.h | 3 | ||||
-rw-r--r-- | ui-log.c | 6 | ||||
-rw-r--r-- | ui-repolist.c | 3 | ||||
-rw-r--r-- | ui-shared.c | 13 | ||||
-rw-r--r-- | ui-summary.c | 2 | ||||
-rw-r--r-- | ui-tree.c | 2 |
6 files changed, 21 insertions, 8 deletions
@@ -235,13 +235,14 @@ extern char *cgit_pageurl(const char *reponame, const char *pagename, | |||
235 | 235 | ||
236 | extern const char *cgit_repobasename(const char *reponame); | 236 | extern const char *cgit_repobasename(const char *reponame); |
237 | 237 | ||
238 | extern void cgit_tree_link(char *name, char *title, char *class, char *head, | 238 | extern void cgit_tree_link(char *name, char *title, char *class, char *head, |
239 | char *rev, char *path); | 239 | char *rev, char *path); |
240 | extern void cgit_log_link(char *name, char *title, char *class, char *head, | 240 | extern void cgit_log_link(char *name, char *title, char *class, char *head, |
241 | char *rev, char *path, int ofs); | 241 | char *rev, char *path, int ofs, char *grep, |
242 | char *pattern); | ||
242 | extern void cgit_commit_link(char *name, char *title, char *class, char *head, | 243 | extern void cgit_commit_link(char *name, char *title, char *class, char *head, |
243 | char *rev); | 244 | char *rev); |
244 | extern void cgit_refs_link(char *name, char *title, char *class, char *head, | 245 | extern void cgit_refs_link(char *name, char *title, char *class, char *head, |
245 | char *rev, char *path); | 246 | char *rev, char *path); |
246 | extern void cgit_snapshot_link(char *name, char *title, char *class, | 247 | extern void cgit_snapshot_link(char *name, char *title, char *class, |
247 | char *head, char *rev, char *archivename); | 248 | char *head, char *rev, char *archivename); |
@@ -115,17 +115,19 @@ void cgit_print_log(const char *tip, int ofs, int cnt, char *grep, char *pattern | |||
115 | 115 | ||
116 | if (pager) { | 116 | if (pager) { |
117 | html("<div class='pager'>"); | 117 | html("<div class='pager'>"); |
118 | if (ofs > 0) { | 118 | if (ofs > 0) { |
119 | cgit_log_link("[prev]", NULL, NULL, cgit_query_head, | 119 | cgit_log_link("[prev]", NULL, NULL, cgit_query_head, |
120 | cgit_query_sha1, cgit_query_path, | 120 | cgit_query_sha1, cgit_query_path, |
121 | ofs - cnt); | 121 | ofs - cnt, cgit_query_grep, |
122 | cgit_query_search); | ||
122 | html(" "); | 123 | html(" "); |
123 | } | 124 | } |
124 | if ((commit = get_revision(&rev)) != NULL) { | 125 | if ((commit = get_revision(&rev)) != NULL) { |
125 | cgit_log_link("[next]", NULL, NULL, cgit_query_head, | 126 | cgit_log_link("[next]", NULL, NULL, cgit_query_head, |
126 | cgit_query_sha1, cgit_query_path, | 127 | cgit_query_sha1, cgit_query_path, |
127 | ofs + cnt); | 128 | ofs + cnt, cgit_query_grep, |
129 | cgit_query_search); | ||
128 | } | 130 | } |
129 | html("</div>"); | 131 | html("</div>"); |
130 | } | 132 | } |
131 | } | 133 | } |
diff --git a/ui-repolist.c b/ui-repolist.c index 4c86543..9aa5c1e 100644 --- a/ui-repolist.c +++ b/ui-repolist.c | |||
@@ -95,13 +95,14 @@ void cgit_print_repolist(struct cacheitem *item) | |||
95 | html("</td>"); | 95 | html("</td>"); |
96 | if (cgit_enable_index_links) { | 96 | if (cgit_enable_index_links) { |
97 | html("<td>"); | 97 | html("<td>"); |
98 | html_link_open(cgit_repourl(cgit_repo->url), | 98 | html_link_open(cgit_repourl(cgit_repo->url), |
99 | NULL, "button"); | 99 | NULL, "button"); |
100 | html("summary</a>"); | 100 | html("summary</a>"); |
101 | cgit_log_link("log", NULL, "button", NULL, NULL, NULL, 0); | 101 | cgit_log_link("log", NULL, "button", NULL, NULL, NULL, |
102 | 0, NULL, NULL); | ||
102 | cgit_tree_link("tree", NULL, "button", NULL, NULL, NULL); | 103 | cgit_tree_link("tree", NULL, "button", NULL, NULL, NULL); |
103 | html("</td>"); | 104 | html("</td>"); |
104 | } | 105 | } |
105 | html("</tr>\n"); | 106 | html("</tr>\n"); |
106 | } | 107 | } |
107 | html("</table>"); | 108 | html("</table>"); |
diff --git a/ui-shared.c b/ui-shared.c index 1d66940..a03661a 100644 --- a/ui-shared.c +++ b/ui-shared.c | |||
@@ -191,23 +191,32 @@ void cgit_tree_link(char *name, char *title, char *class, char *head, | |||
191 | char *rev, char *path) | 191 | char *rev, char *path) |
192 | { | 192 | { |
193 | reporevlink("tree", name, title, class, head, rev, path); | 193 | reporevlink("tree", name, title, class, head, rev, path); |
194 | } | 194 | } |
195 | 195 | ||
196 | void cgit_log_link(char *name, char *title, char *class, char *head, | 196 | void cgit_log_link(char *name, char *title, char *class, char *head, |
197 | char *rev, char *path, int ofs) | 197 | char *rev, char *path, int ofs, char *grep, char *pattern) |
198 | { | 198 | { |
199 | char *delim; | 199 | char *delim; |
200 | 200 | ||
201 | delim = repolink(title, class, "log", head, path); | 201 | delim = repolink(title, class, "log", head, path); |
202 | if (rev && strcmp(rev, cgit_query_head)) { | 202 | if (rev && strcmp(rev, cgit_query_head)) { |
203 | html(delim); | 203 | html(delim); |
204 | html("id="); | 204 | html("id="); |
205 | html_attr(rev); | 205 | html_attr(rev); |
206 | delim = "&"; | 206 | delim = "&"; |
207 | } | 207 | } |
208 | if (grep && pattern) { | ||
209 | html(delim); | ||
210 | html("qt="); | ||
211 | html_attr(grep); | ||
212 | delim = "&"; | ||
213 | html(delim); | ||
214 | html("q="); | ||
215 | html_attr(pattern); | ||
216 | } | ||
208 | if (ofs > 0) { | 217 | if (ofs > 0) { |
209 | html(delim); | 218 | html(delim); |
210 | html("ofs="); | 219 | html("ofs="); |
211 | htmlf("%d", ofs); | 220 | htmlf("%d", ofs); |
212 | } | 221 | } |
213 | html("'>"); | 222 | html("'>"); |
@@ -458,13 +467,13 @@ void cgit_print_pageheader(char *title, int show_search) | |||
458 | html_txt(cgit_repo->owner); | 467 | html_txt(cgit_repo->owner); |
459 | } | 468 | } |
460 | html("<p>\n<h1>navigate</h1>\n"); | 469 | html("<p>\n<h1>navigate</h1>\n"); |
461 | reporevlink(NULL, "summary", NULL, "menu", cgit_query_head, | 470 | reporevlink(NULL, "summary", NULL, "menu", cgit_query_head, |
462 | NULL, NULL); | 471 | NULL, NULL); |
463 | cgit_log_link("log", NULL, "menu", cgit_query_head, | 472 | cgit_log_link("log", NULL, "menu", cgit_query_head, |
464 | cgit_query_sha1, cgit_query_path, 0); | 473 | cgit_query_sha1, cgit_query_path, 0, NULL, NULL); |
465 | cgit_tree_link("tree", NULL, "menu", cgit_query_head, | 474 | cgit_tree_link("tree", NULL, "menu", cgit_query_head, |
466 | cgit_query_sha1, NULL); | 475 | cgit_query_sha1, NULL); |
467 | cgit_commit_link("commit", NULL, "menu", cgit_query_head, | 476 | cgit_commit_link("commit", NULL, "menu", cgit_query_head, |
468 | cgit_query_sha1); | 477 | cgit_query_sha1); |
469 | cgit_diff_link("diff", NULL, "menu", cgit_query_head, | 478 | cgit_diff_link("diff", NULL, "menu", cgit_query_head, |
470 | cgit_query_sha1, cgit_query_sha2, | 479 | cgit_query_sha1, cgit_query_sha2, |
diff --git a/ui-summary.c b/ui-summary.c index 39fe330..c856793 100644 --- a/ui-summary.c +++ b/ui-summary.c | |||
@@ -53,13 +53,13 @@ static int print_branch(struct refinfo *ref) | |||
53 | struct commitinfo *info = ref->commit; | 53 | struct commitinfo *info = ref->commit; |
54 | char *name = (char *)ref->refname; | 54 | char *name = (char *)ref->refname; |
55 | 55 | ||
56 | if (!info) | 56 | if (!info) |
57 | return 1; | 57 | return 1; |
58 | html("<tr><td>"); | 58 | html("<tr><td>"); |
59 | cgit_log_link(name, NULL, NULL, name, NULL, NULL, 0); | 59 | cgit_log_link(name, NULL, NULL, name, NULL, NULL, 0, NULL, NULL); |
60 | html("</td><td>"); | 60 | html("</td><td>"); |
61 | 61 | ||
62 | if (ref->object->type == OBJ_COMMIT) { | 62 | if (ref->object->type == OBJ_COMMIT) { |
63 | cgit_print_age(info->commit->date, -1, NULL); | 63 | cgit_print_age(info->commit->date, -1, NULL); |
64 | html("</td><td>"); | 64 | html("</td><td>"); |
65 | html_txt(info->author); | 65 | html_txt(info->author); |
@@ -97,13 +97,13 @@ static int ls_item(const unsigned char *sha1, const char *base, int baselen, | |||
97 | curr_rev, fullpath); | 97 | curr_rev, fullpath); |
98 | } | 98 | } |
99 | htmlf("</td><td class='ls-size'>%li</td>", size); | 99 | htmlf("</td><td class='ls-size'>%li</td>", size); |
100 | 100 | ||
101 | html("<td>"); | 101 | html("<td>"); |
102 | cgit_log_link("log", NULL, "button", cgit_query_head, curr_rev, | 102 | cgit_log_link("log", NULL, "button", cgit_query_head, curr_rev, |
103 | fullpath, 0); | 103 | fullpath, 0, NULL, NULL); |
104 | html("</td></tr>\n"); | 104 | html("</td></tr>\n"); |
105 | free(name); | 105 | free(name); |
106 | return 0; | 106 | return 0; |
107 | } | 107 | } |
108 | 108 | ||
109 | static void ls_head() | 109 | static void ls_head() |