about summary refs log tree commit diff
path: root/ui-shared.c
diff options
context:
space:
mode:
authorLars Hjemli <hjemli@gmail.com>2011-02-19 14:51:00 +0100
committerLars Hjemli <hjemli@gmail.com>2011-02-19 14:51:00 +0100
commit979c460e7f71d153ae79da67b8b21c3412f0fe02 (patch)
tree6da9ffb66ed0a68205e6644cb7e2b4652d6684be /ui-shared.c
parentMerge branch 'jh/scan-path' (diff)
parentUse transparent background for the cgit logo (diff)
downloadcgit-pink-979c460e7f71d153ae79da67b8b21c3412f0fe02.tar.gz
cgit-pink-979c460e7f71d153ae79da67b8b21c3412f0fe02.zip
Merge branch 'br/misc'
* br/misc:
  Use transparent background for the cgit logo
  ssdiff: anchors for ssdiff
  implement repo.logo and repo.logo-link
Diffstat (limited to 'ui-shared.c')
-rw-r--r--ui-shared.c18
1 files changed, 14 insertions, 4 deletions
diff --git a/ui-shared.c b/ui-shared.c
index ae29615..7efae7a 100644
--- a/ui-shared.c
+++ b/ui-shared.c
@@ -756,17 +756,27 @@ static void cgit_print_path_crumbs(struct cgit_context *ctx, char *path)
 
 static void print_header(struct cgit_context *ctx)
 {
+	char *logo = NULL, *logo_link = NULL;
+
 	html("<table id='header'>\n");
 	html("<tr>\n");
 
-	if (ctx->cfg.logo && ctx->cfg.logo[0] != 0) {
+	if (ctx->repo && ctx->repo->logo && *ctx->repo->logo)
+		logo = ctx->repo->logo;
+	else
+		logo = ctx->cfg.logo;
+	if (ctx->repo && ctx->repo->logo_link && *ctx->repo->logo_link)
+		logo_link = ctx->repo->logo_link;
+	else
+		logo_link = ctx->cfg.logo_link;
+	if (logo && *logo) {
 		html("<td class='logo' rowspan='2'><a href='");
-		if (ctx->cfg.logo_link)
-			html_attr(ctx->cfg.logo_link);
+		if (logo_link && *logo_link)
+			html_attr(logo_link);
 		else
 			html_attr(cgit_rooturl());
 		html("'><img src='");
-		html_attr(ctx->cfg.logo);
+		html_attr(logo);
 		html("' alt='cgit logo'/></a></td>\n");
 	}