This is not really needed for personal sites where all repos belong to
the same person. Since it is pretty useful for shared sites however, it
should be configurable.
Signed-off-by: Florian Pritz <bluewind@xinu.at>
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
ctx.cfg.enable_http_clone = atoi(value);
else if (!strcmp(name, "enable-index-links"))
ctx.cfg.enable_index_links = atoi(value);
ctx.cfg.enable_http_clone = atoi(value);
else if (!strcmp(name, "enable-index-links"))
ctx.cfg.enable_index_links = atoi(value);
+ else if (!strcmp(name, "enable-index-owner"))
+ ctx.cfg.enable_index_owner = atoi(value);
else if (!strcmp(name, "enable-commit-graph"))
ctx.cfg.enable_commit_graph = atoi(value);
else if (!strcmp(name, "enable-log-filecount"))
else if (!strcmp(name, "enable-commit-graph"))
ctx.cfg.enable_commit_graph = atoi(value);
else if (!strcmp(name, "enable-log-filecount"))
ctx->cfg.logo = "/cgit.png";
ctx->cfg.local_time = 0;
ctx->cfg.enable_http_clone = 1;
ctx->cfg.logo = "/cgit.png";
ctx->cfg.local_time = 0;
ctx->cfg.enable_http_clone = 1;
+ ctx->cfg.enable_index_owner = 1;
ctx->cfg.enable_tree_linenumbers = 1;
ctx->cfg.enable_git_config = 0;
ctx->cfg.max_repo_count = 50;
ctx->cfg.enable_tree_linenumbers = 1;
ctx->cfg.enable_git_config = 0;
ctx->cfg.max_repo_count = 50;
int enable_filter_overrides;
int enable_http_clone;
int enable_index_links;
int enable_filter_overrides;
int enable_http_clone;
int enable_index_links;
+ int enable_index_owner;
int enable_commit_graph;
int enable_log_filecount;
int enable_log_linecount;
int enable_commit_graph;
int enable_log_filecount;
int enable_log_linecount;
each repo in the repository index (specifically, to the "summary",
"commit" and "tree" pages). Default value: "0".
each repo in the repository index (specifically, to the "summary",
"commit" and "tree" pages). Default value: "0".
+enable-index-owner::
+ Flag which, when set to "1", will make cgit display the owner of
+ each repo in the repository index. Default value: "1".
+
enable-log-filecount::
Flag which, when set to "1", will make cgit print the number of
modified files for each commit on the repository log page. Default
enable-log-filecount::
Flag which, when set to "1", will make cgit print the number of
modified files for each commit on the repository log page. Default
htmlf("'>%s</a></th>", title);
}
htmlf("'>%s</a></th>", title);
}
-void print_header(int columns)
{
html("<tr class='nohover'>");
print_sort_header("Name", "name");
print_sort_header("Description", "desc");
{
html("<tr class='nohover'>");
print_sort_header("Name", "name");
print_sort_header("Description", "desc");
- print_sort_header("Owner", "owner");
+ if (ctx.cfg.enable_index_owner)
+ print_sort_header("Owner", "owner");
print_sort_header("Idle", "idle");
if (ctx.cfg.enable_index_links)
html("<th class='left'>Links</th>");
print_sort_header("Idle", "idle");
if (ctx.cfg.enable_index_links)
html("<th class='left'>Links</th>");
void cgit_print_repolist()
{
void cgit_print_repolist()
{
- int i, columns = 4, hits = 0, header = 0;
+ int i, columns = 3, hits = 0, header = 0;
char *last_section = NULL;
char *section;
int sorted = 0;
if (ctx.cfg.enable_index_links)
char *last_section = NULL;
char *section;
int sorted = 0;
if (ctx.cfg.enable_index_links)
+ ++columns;
+ if (ctx.cfg.enable_index_owner)
+ ++columns;
ctx.page.title = ctx.cfg.root_title;
cgit_print_http_headers(&ctx);
ctx.page.title = ctx.cfg.root_title;
cgit_print_http_headers(&ctx);
if (hits > ctx.qry.ofs + ctx.cfg.max_repo_count)
continue;
if (!header++)
if (hits > ctx.qry.ofs + ctx.cfg.max_repo_count)
continue;
if (!header++)
section = ctx.repo->section;
if (section && !strcmp(section, ""))
section = NULL;
section = ctx.repo->section;
if (section && !strcmp(section, ""))
section = NULL;
html_ntxt(ctx.cfg.max_repodesc_len, ctx.repo->desc);
html_link_close();
html("</td><td>");
html_ntxt(ctx.cfg.max_repodesc_len, ctx.repo->desc);
html_link_close();
html("</td><td>");
- html_txt(ctx.repo->owner);
- html("</td><td>");
+ if (ctx.cfg.enable_index_owner) {
+ html_txt(ctx.repo->owner);
+ html("</td><td>");
+ }
print_modtime(ctx.repo);
html("</td>");
if (ctx.cfg.enable_index_links) {
print_modtime(ctx.repo);
html("</td>");
if (ctx.cfg.enable_index_links) {