about summary refs log tree commit diff stats
path: root/ui-shared.c
diff options
context:
space:
mode:
authorBernhard Reutner-Fischer2010-12-23 12:47:54 +0100
committerLars Hjemli2011-02-19 14:41:39 +0100
commit808c685ebb7cd2d24d3881b74e3be2439bd1393b (patch)
tree5bb224b73bbbc7d57864c587cc022fcc9826f4b3 /ui-shared.c
parentui-stats: Remove unnecessary #include (diff)
downloadcgit-808c685ebb7cd2d24d3881b74e3be2439bd1393b.tar.gz
cgit-808c685ebb7cd2d24d3881b74e3be2439bd1393b.zip
implement repo.logo and repo.logo-link
Allow for per repo logo and logo-link; Use global logo and logo-link per
default.

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
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)
756 756
757static void print_header(struct cgit_context *ctx) 757static void print_header(struct cgit_context *ctx)
758{ 758{
759 char *logo = NULL, *logo_link = NULL;
760
759 html("<table id='header'>\n"); 761 html("<table id='header'>\n");
760 html("<tr>\n"); 762 html("<tr>\n");
761 763
762 if (ctx->cfg.logo && ctx->cfg.logo[0] != 0) { 764 if (ctx->repo && ctx->repo->logo && *ctx->repo->logo)
765 logo = ctx->repo->logo;
766 else
767 logo = ctx->cfg.logo;
768 if (ctx->repo && ctx->repo->logo_link && *ctx->repo->logo_link)
769 logo_link = ctx->repo->logo_link;
770 else
771 logo_link = ctx->cfg.logo_link;
772 if (logo && *logo) {
763 html("<td class='logo' rowspan='2'><a href='"); 773 html("<td class='logo' rowspan='2'><a href='");
764 if (ctx->cfg.logo_link) 774 if (logo_link && *logo_link)
765 html_attr(ctx->cfg.logo_link); 775 html_attr(logo_link);
766 else 776 else
767 html_attr(cgit_rooturl()); 777 html_attr(cgit_rooturl());
768 html("'><img src='"); 778 html("'><img src='");
769 html_attr(ctx->cfg.logo); 779 html_attr(logo);
770 html("' alt='cgit logo'/></a></td>\n"); 780 html("' alt='cgit logo'/></a></td>\n");
771 } 781 }
772 782