return fmt("%s/", ctx.cfg.virtual_root);
}
-static void site_url(char *page, char *search)
+static void site_url(char *page, char *search, int ofs)
{
char *delim = "?";
html(delim);
html("q=");
html_attr(search);
+ delim = "&";
+ }
+ if (ofs) {
+ html(delim);
+ htmlf("ofs=%d", ofs);
}
}
static void site_link(char *page, char *name, char *title, char *class,
- char *search)
+ char *search, int ofs)
{
html("<a");
if (title) {
html("'");
}
html(" href='");
- site_url(page, search);
+ site_url(page, search, ofs);
html("'>");
html_txt(name);
html("</a>");
}
+void cgit_index_link(char *name, char *title, char *class, char *pattern,
+ int ofs)
+{
+ site_link(NULL, name, title, class, pattern, ofs);
+}
+
static char *repolink(char *title, char *class, char *page, char *head,
char *path)
{
void cgit_print_docend()
{
+ html("</div><div class='footer'>generated ");
+ cgit_print_date(time(NULL), FMT_LONGDATE);
+ htmlf(" by cgit %s", cgit_version);
html("</div>\n</body>\n</html>\n");
}
html("<td class='main'>");
if (ctx->repo) {
+ cgit_index_link("index", NULL, NULL, NULL, 0);
+ html(" : ");
reporevlink(NULL, ctx->repo->name, NULL, hc(cmd, "summary"),
ctx->qry.head, NULL, NULL);
- html(" : ");
- html_txt(ctx->qry.page);
html("</td><td class='form'>");
html("<form method='get' action=''>\n");
add_hidden_formfields(0, 1, ctx->qry.page);
html("<input type='submit' value='search'/>\n");
html("</form>\n");
} else {
- site_link(NULL, "index", NULL, hc(cmd, "repolist"), NULL);
+ site_link(NULL, "index", NULL, hc(cmd, "repolist"), NULL, 0);
if (ctx->cfg.root_readme)
- site_link("about", "about", NULL, hc(cmd, "about"), NULL);
+ site_link("about", "about", NULL, hc(cmd, "about"),
+ NULL, 0);
html("</td><td class='form'>");
html("<form method='get' action='");
html_attr(cgit_rooturl());