about summary refs log tree commit diff
path: root/ui-repolist.c
diff options
context:
space:
mode:
authorChris Burroughs <chris.burroughs@gmail.com>2014-08-04 09:23:08 -0400
committerJason A. Donenfeld <Jason@zx2c4.com>2014-12-23 19:08:20 -0700
commit96ceb9a95a7a321209cff347fefd141a9fffc7ca (patch)
tree5077ac54da1f7992d991746492855665454147c9 /ui-repolist.c
parentui-shared: add rel-vcs microformat links to HTML header (diff)
downloadcgit-pink-96ceb9a95a7a321209cff347fefd141a9fffc7ca.tar.gz
cgit-pink-96ceb9a95a7a321209cff347fefd141a9fffc7ca.zip
repolist: add owner-filter
This allows custom links to be used for repository owners by
configuring a filter to be applied in the "Owner" column in the
repository list.
Diffstat (limited to 'ui-repolist.c')
-rw-r--r--ui-repolist.c20
1 files changed, 13 insertions, 7 deletions
diff --git a/ui-repolist.c b/ui-repolist.c
index 49c991f..f929cb7 100644
--- a/ui-repolist.c
+++ b/ui-repolist.c
@@ -307,13 +307,19 @@ void cgit_print_repolist()
 		html_link_close();
 		html("</td><td>");
 		if (ctx.cfg.enable_index_owner) {
-			html("<a href='");
-			html_attr(cgit_rooturl());
-			html("?q=");
-			html_url_arg(ctx.repo->owner);
-			html("'>");
-			html_txt(ctx.repo->owner);
-			html("</a>");
+			if (ctx.repo->owner_filter) {
+				cgit_open_filter(ctx.repo->owner_filter);
+				html_txt(ctx.repo->owner);
+				cgit_close_filter(ctx.repo->owner_filter);
+			} else {
+				html("<a href='");
+				html_attr(cgit_rooturl());
+				html("?=");
+				html_url_arg(ctx.repo->owner);
+				html("'>");
+				html_txt(ctx.repo->owner);
+				html("</a>");
+			}
 			html("</td><td>");
 		}
 		print_modtime(ctx.repo);