mirror of
https://git.zx2c4.com/cgit
synced 2025-07-02 22:34:32 +02:00
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>
This commit is contained in:
parent
17596459fe
commit
808c685ebb
4 changed files with 31 additions and 6 deletions
18
ui-shared.c
18
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");
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue