aboutsummaryrefslogtreecommitdiff
diff refs
from: back
to: back
| flip
diff options
context:
space:
mode:
-rw-r--r--cgit.h2
-rw-r--r--ui-log.c16
-rw-r--r--ui-repolist.c2
-rw-r--r--ui-shared.c22
-rw-r--r--ui-summary.c2
-rw-r--r--ui-tree.c2
6 files changed, 16 insertions, 30 deletions
diff --git a/cgit.h b/cgit.h
index a59a370..ddb2fff 100644
--- a/cgit.h
+++ b/cgit.h
@@ -206,7 +206,7 @@ extern char *cgit_pageurl(const char *reponame, const char *pagename,
extern void cgit_tree_link(char *name, char *title, char *class, char *head,
char *rev, char *path);
extern void cgit_log_link(char *name, char *title, char *class, char *head,
- char *rev, char *path, int ofs);
+ char *rev, char *path);
extern void cgit_commit_link(char *name, char *title, char *class, char *head,
char *rev);
extern void cgit_diff_link(char *name, char *title, char *class, char *head,
diff --git a/ui-log.c b/ui-log.c
index d38e40a..95cb453 100644
--- a/ui-log.c
+++ b/ui-log.c
@@ -113,15 +113,17 @@ void cgit_print_log(const char *tip, int ofs, int cnt, char *grep, char *path, i
if (pager) {
html("<div class='pager'>");
if (ofs > 0) {
- cgit_log_link("[prev]", NULL, NULL, cgit_query_head,
- cgit_query_sha1, cgit_query_path,
- ofs - cnt);
- html("&nbsp;");
+ html("&nbsp;<a href='");
+ html(cgit_pageurl(cgit_query_repo, cgit_query_page,
+ fmt("h=%s&amp;ofs=%d", tip, ofs-cnt)));
+ html("'>[prev]</a>&nbsp;");
}
+
if ((commit = get_revision(&rev)) != NULL) {
- cgit_log_link("[next]", NULL, NULL, cgit_query_head,
- cgit_query_sha1, cgit_query_path,
- ofs + cnt);
+ html("&nbsp;<a href='");
+ html(cgit_pageurl(cgit_query_repo, "log",
+ fmt("h=%s&amp;ofs=%d", tip, ofs+cnt)));
+ html("'>[next]</a>&nbsp;");
}
html("</div>");
}
diff --git a/ui-repolist.c b/ui-repolist.c
index 4c86543..c735368 100644
--- a/ui-repolist.c
+++ b/ui-repolist.c
@@ -98,7 +98,7 @@ void cgit_print_repolist(struct cacheitem *item)
html_link_open(cgit_repourl(cgit_repo->url),
NULL, "button");
html("summary</a>");
- cgit_log_link("log", NULL, "button", NULL, NULL, NULL, 0);
+ cgit_log_link("log", NULL, "button", NULL, NULL, NULL);
cgit_tree_link("tree", NULL, "button", NULL, NULL, NULL);
html("</td>");
}
diff --git a/ui-shared.c b/ui-shared.c
index bfcc2ac..64c237f 100644
--- a/ui-shared.c
+++ b/ui-shared.c
@@ -163,25 +163,9 @@ void cgit_tree_link(char *name, char *title, char *class, char *head,
}
void cgit_log_link(char *name, char *title, char *class, char *head,
- char *rev, char *path, int ofs)
+ char *rev, char *path)
{
- char *delim;
-
- delim = repolink(title, class, "log", head, path);
- if (rev && strcmp(rev, cgit_query_head)) {
- html(delim);
- html("id=");
- html_attr(rev);
- delim = "&";
- }
- if (ofs > 0) {
- html(delim);
- html("ofs=");
- htmlf("%d", ofs);
- }
- html("'>");
- html_txt(name);
- html("</a>");
+ reporevlink("log", name, title, class, head, rev, path);
}
void cgit_commit_link(char *name, char *title, char *class, char *head,
@@ -318,7 +302,7 @@ void cgit_print_pageheader(char *title, int show_search)
NULL, NULL);
html(" ");
cgit_log_link("log", NULL, NULL, cgit_query_head,
- cgit_query_sha1, cgit_query_path, 0);
+ cgit_query_sha1, cgit_query_path);
html(" ");
cgit_tree_link("tree", NULL, NULL, cgit_query_head,
cgit_query_sha1, NULL);
diff --git a/ui-summary.c b/ui-summary.c
index b4bc6d8..03dd078 100644
--- a/ui-summary.c
+++ b/ui-summary.c
@@ -27,7 +27,7 @@ static int cgit_print_branch_cb(const char *refname, const unsigned char *sha1,
if (commit && !parse_commit(commit)){
info = cgit_parse_commit(commit);
html("<tr><td>");
- cgit_log_link(ref, NULL, NULL, ref, NULL, NULL, 0);
+ cgit_log_link(ref, NULL, NULL, ref, NULL, NULL);
html("</td><td>");
cgit_print_age(commit->date, -1, NULL);
html("</td><td>");
diff --git a/ui-tree.c b/ui-tree.c
index c5d64ff..b6cb813 100644
--- a/ui-tree.c
+++ b/ui-tree.c
@@ -93,7 +93,7 @@ static int ls_item(const unsigned char *sha1, const char *base, int baselen,
html("<td>");
cgit_log_link("log", NULL, "button", cgit_query_head, curr_rev,
- fullpath, 0);
+ fullpath);
html("</td></tr>\n");
free(name);
return 0;