summaryrefslogtreecommitdiffabout
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--cgit.css2
-rw-r--r--cgit.h2
-rw-r--r--cgitrc7
-rw-r--r--html.c3
-rw-r--r--shared.c6
-rw-r--r--ui-tree.c19
6 files changed, 27 insertions, 12 deletions
diff --git a/cgit.css b/cgit.css
index 640bbc9..ef4bc62 100644
--- a/cgit.css
+++ b/cgit.css
@@ -143,3 +143,3 @@ div.error {
143 143
144div.ls-blob, div.ls-dir { 144td.ls-blob, td.ls-dir, td.ls-mod {
145 font-family: monospace; 145 font-family: monospace;
diff --git a/cgit.h b/cgit.h
index 292e488..b7f8827 100644
--- a/cgit.h
+++ b/cgit.h
@@ -35,2 +35,3 @@ struct repoinfo {
35 char *owner; 35 char *owner;
36 char *module_link;
36 int snapshots; 37 int snapshots;
@@ -72,2 +73,3 @@ extern char *cgit_logo;
72extern char *cgit_logo_link; 73extern char *cgit_logo_link;
74extern char *cgit_module_link;
73extern char *cgit_virtual_root; 75extern char *cgit_virtual_root;
diff --git a/cgitrc b/cgitrc
index 3bae642..f217b39 100644
--- a/cgitrc
+++ b/cgitrc
@@ -49,2 +49,6 @@
49 49
50## Url loaded when clicking a submodule link
51#module-link=./?repo=%s&page=commit&id=%s
52
53
50## Number of chars shown of commit subject message (in log view) 54## Number of chars shown of commit subject message (in log view)
@@ -83,2 +87,3 @@
83#repo.owner=Lars Hjemli 87#repo.owner=Lars Hjemli
84#repo.snapshots=1 # override a sitewide snapshot-setting 88 #repo.snapshots=1 # override a sitewide snapshot-setting
89 #repo.module-link=/git/%s/commit/?id=%s # override the standard module-link
diff --git a/html.c b/html.c
index c0b2ed4..175b4b6 100644
--- a/html.c
+++ b/html.c
@@ -160,2 +160,4 @@ void html_filemode(unsigned short mode)
160 html("l"); 160 html("l");
161 else if (S_ISDIRLNK(mode))
162 html("m");
161 else 163 else
@@ -166,2 +168 @@ void html_filemode(unsigned short mode)
166} }
167
diff --git a/shared.c b/shared.c
index 531d8c0..19d2df0 100644
--- a/shared.c
+++ b/shared.c
@@ -17,2 +17,3 @@ char *cgit_logo = "/git-logo.png";
17char *cgit_logo_link = "http://www.kernel.org/pub/software/scm/git/docs/"; 17char *cgit_logo_link = "http://www.kernel.org/pub/software/scm/git/docs/";
18char *cgit_module_link = "./?repo=%s&page=commit&id=%s";
18char *cgit_virtual_root = NULL; 19char *cgit_virtual_root = NULL;
@@ -87,2 +88,3 @@ struct repoinfo *add_repo(const char *url)
87 ret->snapshots = cgit_snapshots; 88 ret->snapshots = cgit_snapshots;
89 ret->module_link = cgit_module_link;
88 return ret; 90 return ret;
@@ -100,2 +102,4 @@ void cgit_global_config_cb(const char *name, const char *value)
100 cgit_logo_link = xstrdup(value); 102 cgit_logo_link = xstrdup(value);
103 else if (!strcmp(name, "module-link"))
104 cgit_module_link = xstrdup(value);
101 else if (!strcmp(name, "virtual-root")) 105 else if (!strcmp(name, "virtual-root"))
@@ -130,2 +134,4 @@ void cgit_global_config_cb(const char *name, const char *value)
130 cgit_repo->snapshots = atoi(value); 134 cgit_repo->snapshots = atoi(value);
135 else if (cgit_repo && !strcmp(name, "repo.module-link"))
136 cgit_repo->module_link= xstrdup(value);
131} 137}
diff --git a/ui-tree.c b/ui-tree.c
index 60f7560..dee8309 100644
--- a/ui-tree.c
+++ b/ui-tree.c
@@ -17,3 +17,3 @@ static int print_entry(const unsigned char *sha1, const char *base,
17 enum object_type type; 17 enum object_type type;
18 unsigned long size; 18 unsigned long size = 0;
19 19
@@ -21,3 +21,3 @@ static int print_entry(const unsigned char *sha1, const char *base,
21 type = sha1_object_info(sha1, &size); 21 type = sha1_object_info(sha1, &size);
22 if (type == OBJ_BAD) { 22 if (type == OBJ_BAD && !S_ISDIRLNK(mode)) {
23 htmlf("<tr><td colspan='3'>Bad object: %s %s</td></tr>", 23 htmlf("<tr><td colspan='3'>Bad object: %s %s</td></tr>",
@@ -29,7 +29,10 @@ static int print_entry(const unsigned char *sha1, const char *base,
29 html_filemode(mode); 29 html_filemode(mode);
30 html("</td><td>"); 30 html("</td><td ");
31 if (S_ISDIRLNK(mode)) { 31 if (S_ISDIRLNK(mode)) {
32 htmlf("<div class='ls-dirlnk'>%s => submodule</div>", name); 32 htmlf("class='ls-mod'><a href='");
33 html_attr(fmt(cgit_repo->module_link,
34 name,
35 sha1_to_hex(sha1)));
33 } else if (S_ISDIR(mode)) { 36 } else if (S_ISDIR(mode)) {
34 html("<div class='ls-dir'><a href='"); 37 html("class='ls-dir'><a href='");
35 html_attr(cgit_pageurl(cgit_query_repo, "tree", 38 html_attr(cgit_pageurl(cgit_query_repo, "tree",
@@ -39,5 +42,4 @@ static int print_entry(const unsigned char *sha1, const char *base,
39 pathname))); 42 pathname)));
40 htmlf("'>%s</a></div>", name);
41 } else { 43 } else {
42 html("<div class='ls-blob'><a href='"); 44 html("class='ls-blob'><a href='");
43 html_attr(cgit_pageurl(cgit_query_repo, "view", 45 html_attr(cgit_pageurl(cgit_query_repo, "view",
@@ -46,5 +48,4 @@ static int print_entry(const unsigned char *sha1, const char *base,
46 pathname))); 48 pathname)));
47 htmlf("'>%s</a></div>", name);
48 } 49 }
49 html("</div></td>"); 50 htmlf("'>%s</a></div></td>", name);
50 htmlf("<td class='filesize'>%li</td>", size); 51 htmlf("<td class='filesize'>%li</td>", size);