diff options
author | Lars Hjemli <hjemli@gmail.com> | 2012-03-18 21:02:58 +0000 |
---|---|---|
committer | Lars Hjemli <hjemli@gmail.com> | 2012-03-18 21:02:58 +0000 |
commit | 3fceaac70783517ecbafdb0ef672bd1f093bb2b6 (patch) | |
tree | d6857497397a44cc2b0cb593e1d8fa5c5cfdb6bc | |
parent | 726ef4d2d06537562ba3105b93a7b485e2fad122 (diff) | |
parent | eeb5b24841a9db9bf0378c6242db651339e1bc91 (diff) | |
download | cgit-3fceaac70783517ecbafdb0ef672bd1f093bb2b6.tar.gz |
Merge branch 'fp/enable-owner' into wip
-rw-r--r-- | cgit.c | 3 | ||||
-rw-r--r-- | cgit.h | 1 | ||||
-rw-r--r-- | cgitrc.5.txt | 4 | ||||
-rw-r--r-- | ui-repolist.c | 9 |
4 files changed, 14 insertions, 3 deletions
@@ -169,6 +169,8 @@ void config_cb(const char *name, const char *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")) @@ -338,6 +340,7 @@ static void prepare_context(struct cgit_context *ctx) ctx->cfg.local_time = 0; ctx->cfg.enable_gitweb_owner = 1; ctx->cfg.enable_http_clone = 1; + ctx->cfg.enable_index_owner = 1; ctx->cfg.enable_tree_linenumbers = 1; ctx->cfg.max_repo_count = 50; ctx->cfg.max_commit_count = 50; @@ -201,6 +201,7 @@ struct cgit_config { int enable_gitweb_owner; int enable_http_clone; int enable_index_links; + int enable_index_owner; int enable_commit_graph; int enable_log_filecount; int enable_log_linecount; diff --git a/cgitrc.5.txt b/cgitrc.5.txt index a72241f..adbafbc 100644 --- a/cgitrc.5.txt +++ b/cgitrc.5.txt @@ -121,6 +121,10 @@ enable-index-links:: 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 diff --git a/ui-repolist.c b/ui-repolist.c index d946f32..45192d2 100644 --- a/ui-repolist.c +++ b/ui-repolist.c @@ -111,7 +111,8 @@ void print_header(int columns) 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>"); @@ -274,8 +275,10 @@ void cgit_print_repolist() 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) { |