summaryrefslogtreecommitdiffabout
Unidiff
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--cgit.h1
-rw-r--r--cgitrc4
-rw-r--r--shared.c3
-rw-r--r--ui-repolist.c25
4 files changed, 26 insertions, 7 deletions
diff --git a/cgit.h b/cgit.h
index bd2dd0d..81c819d 100644
--- a/cgit.h
+++ b/cgit.h
@@ -119,4 +119,5 @@ extern char *cgit_repo_group;
119extern int cgit_nocache; 119extern int cgit_nocache;
120extern int cgit_snapshots; 120extern int cgit_snapshots;
121extern int cgit_enable_index_links;
121extern int cgit_enable_log_filecount; 122extern int cgit_enable_log_filecount;
122extern int cgit_enable_log_linecount; 123extern int cgit_enable_log_linecount;
diff --git a/cgitrc b/cgitrc
index 0f602e4..40877f8 100644
--- a/cgitrc
+++ b/cgitrc
@@ -13,4 +13,8 @@
13 13
14 14
15## Enable/disable extra links to summary/log/tree per repo on index page
16#enable-index-links=0
17
18
15## Enable/disable display of 'number of files changed' in log view 19## Enable/disable display of 'number of files changed' in log view
16#enable-log-filecount=0 20#enable-log-filecount=0
diff --git a/shared.c b/shared.c
index f20fb5c..ab00bc9 100644
--- a/shared.c
+++ b/shared.c
@@ -27,4 +27,5 @@ char *cgit_repo_group = NULL;
27int cgit_nocache = 0; 27int cgit_nocache = 0;
28int cgit_snapshots = 0; 28int cgit_snapshots = 0;
29int cgit_enable_index_links = 0;
29int cgit_enable_log_filecount = 0; 30int cgit_enable_log_filecount = 0;
30int cgit_enable_log_linecount = 0; 31int cgit_enable_log_linecount = 0;
@@ -147,4 +148,6 @@ void cgit_global_config_cb(const char *name, const char *value)
147 else if (!strcmp(name, "snapshots")) 148 else if (!strcmp(name, "snapshots"))
148 cgit_snapshots = atoi(value); 149 cgit_snapshots = atoi(value);
150 else if (!strcmp(name, "enable-index-links"))
151 cgit_enable_index_links = atoi(value);
149 else if (!strcmp(name, "enable-log-filecount")) 152 else if (!strcmp(name, "enable-log-filecount"))
150 cgit_enable_log_filecount = atoi(value); 153 cgit_enable_log_filecount = atoi(value);
diff --git a/ui-repolist.c b/ui-repolist.c
index 4f820a8..c735368 100644
--- a/ui-repolist.c
+++ b/ui-repolist.c
@@ -45,7 +45,10 @@ static void print_modtime(struct repoinfo *repo)
45void cgit_print_repolist(struct cacheitem *item) 45void cgit_print_repolist(struct cacheitem *item)
46{ 46{
47 int i; 47 int i, columns = 4;
48 char *last_group = NULL; 48 char *last_group = NULL;
49 49
50 if (cgit_enable_index_links)
51 columns++;
52
50 cgit_print_docstart(cgit_root_title, item); 53 cgit_print_docstart(cgit_root_title, item);
51 cgit_print_pageheader(cgit_root_title, 0); 54 cgit_print_pageheader(cgit_root_title, 0);
@@ -53,5 +56,6 @@ void cgit_print_repolist(struct cacheitem *item)
53 html("<table class='list nowrap'>"); 56 html("<table class='list nowrap'>");
54 if (cgit_index_header) { 57 if (cgit_index_header) {
55 html("<tr class='nohover'><td colspan='5' class='include-block'>"); 58 htmlf("<tr class='nohover'><td colspan='%d' class='include-block'>",
59 columns);
56 html_include(cgit_index_header); 60 html_include(cgit_index_header);
57 html("</td></tr>"); 61 html("</td></tr>");
@@ -61,6 +65,8 @@ void cgit_print_repolist(struct cacheitem *item)
61 "<th class='left'>Description</th>" 65 "<th class='left'>Description</th>"
62 "<th class='left'>Owner</th>" 66 "<th class='left'>Owner</th>"
63 "<th class='left'>Idle</th>" 67 "<th class='left'>Idle</th>");
64 "<th>Links</th></tr>\n"); 68 if (cgit_enable_index_links)
69 html("<th>Links</th>");
70 html("</tr>\n");
65 71
66 for (i=0; i<cgit_repolist.count; i++) { 72 for (i=0; i<cgit_repolist.count; i++) {
@@ -70,5 +76,6 @@ void cgit_print_repolist(struct cacheitem *item)
70 (last_group != NULL && cgit_repo->group != NULL && 76 (last_group != NULL && cgit_repo->group != NULL &&
71 strcmp(cgit_repo->group, last_group))) { 77 strcmp(cgit_repo->group, last_group))) {
72 html("<tr class='nohover'><td colspan='4' class='repogroup'>"); 78 htmlf("<tr class='nohover'><td colspan='%d' class='repogroup'>",
79 columns);
73 html_txt(cgit_repo->group); 80 html_txt(cgit_repo->group);
74 html("</td></tr>"); 81 html("</td></tr>");
@@ -86,5 +93,7 @@ void cgit_print_repolist(struct cacheitem *item)
86 html("</td><td>"); 93 html("</td><td>");
87 print_modtime(cgit_repo); 94 print_modtime(cgit_repo);
88 html("</td><td>"); 95 html("</td>");
96 if (cgit_enable_index_links) {
97 html("<td>");
89 html_link_open(cgit_repourl(cgit_repo->url), 98 html_link_open(cgit_repourl(cgit_repo->url),
90 NULL, "button"); 99 NULL, "button");
@@ -92,5 +101,7 @@ void cgit_print_repolist(struct cacheitem *item)
92 cgit_log_link("log", NULL, "button", NULL, NULL, NULL); 101 cgit_log_link("log", NULL, "button", NULL, NULL, NULL);
93 cgit_tree_link("tree", NULL, "button", NULL, NULL, NULL); 102 cgit_tree_link("tree", NULL, "button", NULL, NULL, NULL);
94 html("</td></tr>\n"); 103 html("</td>");
104 }
105 html("</tr>\n");
95 } 106 }
96 html("</table>"); 107 html("</table>");