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 '')
-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");
 	}
 
side-effectsJune McEnroe NEVER pass side-effects to a macro. 2018-08-07Define ui.c BUF_LEN with enumJune McEnroe 2018-08-07Hack clang into checking uiFmt format stringsJune McEnroe 2018-08-07Handle PART and QUIT without messagesJune McEnroe 2018-08-07Make safe filling the who bufferJune McEnroe 2018-08-07Add reverse and reset IRC formatting codesJune McEnroe 2018-08-06Rewrite line editing again, add formattingJune McEnroe 2018-08-06Fix allocation size in vaswprintfJune McEnroe This is so embarrassing. It only started crashing once it had strings that were long enough, and then it took me so long to notice this mistake. I was worried I was still doing va_list wrong somehow. 2018-08-06Implement word wrappingJune McEnroe 2018-08-06Use wchar_t strings for all of UIJune McEnroe vaswprintf is a nightmare. 2018-08-06Rename line editing functionsJune McEnroe 2018-08-05Initialize all possible color pairsJune McEnroe This is actually possible with use_default_colors! 2018-08-05Refactor color initializationJune McEnroe 2018-08-05Add ^L redrawJune McEnroe 2018-08-05Use 16 colors if availableJune McEnroe Fall back to using bold if there are only 8 colors. This also allowed bright background colors in 16-color terminals. I must port this system to torus. I'll be able to remove the awful termcap patch hack. 2018-08-05Limit parsed colors to number of mIRC colorsJune McEnroe Oh boy that's embarrassing. 2018-08-04Show source link on exitJune McEnroe 2018-08-04Implement line editing, scrollingJune McEnroe Don't really have a way to implement the M-* keys, and currently missing C-w. 2018-08-04Handle /topicJune McEnroe