summaryrefslogtreecommitdiff
path: root/csvncgi/ui-repolist.c
diff options
context:
space:
mode:
Diffstat (limited to 'csvncgi/ui-repolist.c')
-rw-r--r--csvncgi/ui-repolist.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/csvncgi/ui-repolist.c b/csvncgi/ui-repolist.c
index 44795c2..728f658 100644
--- a/csvncgi/ui-repolist.c
+++ b/csvncgi/ui-repolist.c
@@ -132,8 +132,10 @@ void csvn_print_section_stop( struct strbuf *sb )
void csvn_print_repo( struct strbuf *sb, struct repo *repo )
{
- struct variable owner = { (unsigned char *)"owner", { 0 }, DT_STRING },
+ struct variable repo_root = { (unsigned char *)"repo-root", { 0 }, DT_PATH },
+ owner = { (unsigned char *)"owner", { 0 }, DT_STRING },
description = { (unsigned char *)"description", { 0 }, DT_STRING };
+ struct variable *rroot = NULL;
struct variable *auth = NULL;
struct variable *desc = NULL;
@@ -144,12 +146,16 @@ void csvn_print_repo( struct strbuf *sb, struct repo *repo )
if( !sb || !repo || !repo->path ) return;
- auth = lookup( repo, &owner );
- desc = lookup( repo, &description );
- time = csvn_repo_last_changed_time( repo );
+ rroot = lookup( repo, &repo_root );
+ auth = lookup( repo, &owner );
+ desc = lookup( repo, &description );
+ time = csvn_repo_last_changed_time( repo );
strbuf_addf( sb, " <div class=\"row\">\n" );
- strbuf_addf( sb, " <div class=\"col-name\"><a href=\"/%s/\"><div class=\"repo-name\">%s</div></a></div>\n", repo->path, repo->path );
+ if( rroot )
+ strbuf_addf( sb, " <div class=\"col-name\"><a href=\"/%s/%s/\"><div class=\"repo-name\">%s</div></a></div>\n", (const char *)rroot->_v.vptr, repo->path, repo->path );
+ else
+ strbuf_addf( sb, " <div class=\"col-name\"><a href=\"/%s/\"><div class=\"repo-name\">%s</div></a></div>\n", repo->path, repo->path );
if( desc )
strbuf_addf( sb, " <div class=\"col-desc\"><div onclick=\"trunc(this)\" class=\"repo-desc trunc\">%s</div></div>\n", (const char *)desc->_v.vptr );