summaryrefslogtreecommitdiffabout
path: root/ui-shared.c
Unidiff
Diffstat (limited to 'ui-shared.c') (more/less context) (show whitespace changes)
-rw-r--r--ui-shared.c22
1 files changed, 17 insertions, 5 deletions
diff --git a/ui-shared.c b/ui-shared.c
index d08ede9..f366354 100644
--- a/ui-shared.c
+++ b/ui-shared.c
@@ -115,5 +115,5 @@ char *cgit_currurl()
115} 115}
116 116
117static void site_url(char *page, char *search) 117static void site_url(char *page, char *search, int ofs)
118{ 118{
119 char *delim = "?"; 119 char *delim = "?";
@@ -134,9 +134,14 @@ static void site_url(char *page, char *search)
134 html("q="); 134 html("q=");
135 html_attr(search); 135 html_attr(search);
136 delim = "&";
137 }
138 if (ofs) {
139 html(delim);
140 htmlf("ofs=%d", ofs);
136 } 141 }
137} 142}
138 143
139static void site_link(char *page, char *name, char *title, char *class, 144static void site_link(char *page, char *name, char *title, char *class,
140 char *search) 145 char *search, int ofs)
141{ 146{
142 html("<a"); 147 html("<a");
@@ -152,5 +157,5 @@ static void site_link(char *page, char *name, char *title, char *class,
152 } 157 }
153 html(" href='"); 158 html(" href='");
154 site_url(page, search); 159 site_url(page, search, ofs);
155 html("'>"); 160 html("'>");
156 html_txt(name); 161 html_txt(name);
@@ -158,4 +163,10 @@ static void site_link(char *page, char *name, char *title, char *class,
158} 163}
159 164
165void cgit_index_link(char *name, char *title, char *class, char *pattern,
166 int ofs)
167{
168 site_link(NULL, name, title, class, pattern, ofs);
169}
170
160static char *repolink(char *title, char *class, char *page, char *head, 171static char *repolink(char *title, char *class, char *page, char *head,
161 char *path) 172 char *path)
@@ -597,7 +608,8 @@ void cgit_print_pageheader(struct cgit_context *ctx)
597 html("</form>\n"); 608 html("</form>\n");
598 } else { 609 } else {
599 site_link(NULL, "index", NULL, hc(cmd, "repolist"), NULL); 610 site_link(NULL, "index", NULL, hc(cmd, "repolist"), NULL, 0);
600 if (ctx->cfg.root_readme) 611 if (ctx->cfg.root_readme)
601 site_link("about", "about", NULL, hc(cmd, "about"), NULL); 612 site_link("about", "about", NULL, hc(cmd, "about"),
613 NULL, 0);
602 html("</td><td class='form'>"); 614 html("</td><td class='form'>");
603 html("<form method='get' action='"); 615 html("<form method='get' action='");