Example #1
0
static void site_url(const char *page, const char *search, const char *sort, int ofs)
{
	char *delim = "?";

	if (ctx.cfg.virtual_root)
		html_attr(ctx.cfg.virtual_root);
	else
		html_url_path(ctx.cfg.script_name);

	if (page) {
		htmlf("?p=%s", page);
		delim = "&";
	}
	if (search) {
		html(delim);
		html("q=");
		html_attr(search);
		delim = "&";
	}
	if (sort) {
		html(delim);
		html("s=");
		html_attr(sort);
		delim = "&";
	}
	if (ofs) {
		html(delim);
		htmlf("ofs=%d", ofs);
	}
}
Example #2
0
static void print_url(char *base, char *suffix)
{
	if (!base || !*base)
		return;
	if (urls++ == 0) {
		html("<tr class='nohover'><td colspan='4'>&nbsp;</td></tr>");
		html("<tr><th class='left' colspan='4'>Clone</th></tr>\n");
	}
	if (suffix && *suffix)
		base = fmt("%s/%s", base, suffix);
	html("<tr><td colspan='4'><a href='");
	html_url_path(base);
	html("'>");
	html_txt(base);
	html("</a></td></tr>\n");
}
Example #3
0
static void print_url(const char *url)
{
	int columns = 3;

	if (ctx.repo->enable_log_filecount)
		columns++;
	if (ctx.repo->enable_log_linecount)
		columns++;

	if (urls++ == 0) {
		htmlf("<tr class='nohover'><td colspan='%d'>&nbsp;</td></tr>", columns);
		htmlf("<tr><th class='left' colspan='%d'>Clone</th></tr>\n", columns);
	}

	htmlf("<tr><td colspan='%d'><a rel='vcs-git' href='", columns);
	html_url_path(url);
	html("' title='");
	html_attr(ctx.repo->name);
	html(" Git repository'>");
	html_txt(url);
	html("</a></td></tr>\n");
}