diff options
author | Lars Hjemli <hjemli@gmail.com> | 2009-07-25 19:19:31 (JST) |
---|---|---|
committer | Lars Hjemli <hjemli@gmail.com> | 2009-07-25 19:19:31 (JST) |
commit | ef0c6aadf70e33ef63f0a68ca16338a49d0a3f1f (patch) | |
tree | 4115c32dc27aa18840dda2c940ca10b4a7d0cf86 /ui-shared.c | |
parent | 0cbb50841ac82e08e715bbff614f96c7d5ba22fa (diff) | |
download | cgit-ef0c6aadf70e33ef63f0a68ca16338a49d0a3f1f.zip cgit-ef0c6aadf70e33ef63f0a68ca16338a49d0a3f1f.tar.gz |
Add support for 'noheader' option
This option can be used to disable the standard cgit page header, which
might be useful in combination with the 'embedded' option.
Suggested-by: Mark Constable <markc@renta.net>
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
Diffstat (limited to 'ui-shared.c')
-rw-r--r-- | ui-shared.c | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/ui-shared.c b/ui-shared.c index f18b2c7..5e03a7a 100644 --- a/ui-shared.c +++ b/ui-shared.c | |||
@@ -611,14 +611,8 @@ char *hc(struct cgit_cmd *cmd, const char *page) | |||
611 | return (strcmp(cmd ? cmd->name : fallback_cmd, page) ? NULL : "active"); | 611 | return (strcmp(cmd ? cmd->name : fallback_cmd, page) ? NULL : "active"); |
612 | } | 612 | } |
613 | 613 | ||
614 | void cgit_print_pageheader(struct cgit_context *ctx) | 614 | static void print_header(struct cgit_context *ctx) |
615 | { | 615 | { |
616 | struct cgit_cmd *cmd = cgit_get_cmd(ctx); | ||
617 | |||
618 | if (!cmd && ctx->repo) | ||
619 | fallback_cmd = "summary"; | ||
620 | |||
621 | html("<div id='cgit'>"); | ||
622 | html("<table id='header'>\n"); | 616 | html("<table id='header'>\n"); |
623 | html("<tr>\n"); | 617 | html("<tr>\n"); |
624 | html("<td class='logo' rowspan='2'><a href='"); | 618 | html("<td class='logo' rowspan='2'><a href='"); |
@@ -659,6 +653,18 @@ void cgit_print_pageheader(struct cgit_context *ctx) | |||
659 | html_include(ctx->cfg.index_info); | 653 | html_include(ctx->cfg.index_info); |
660 | } | 654 | } |
661 | html("</td></tr></table>\n"); | 655 | html("</td></tr></table>\n"); |
656 | } | ||
657 | |||
658 | void cgit_print_pageheader(struct cgit_context *ctx) | ||
659 | { | ||
660 | struct cgit_cmd *cmd = cgit_get_cmd(ctx); | ||
661 | |||
662 | if (!cmd && ctx->repo) | ||
663 | fallback_cmd = "summary"; | ||
664 | |||
665 | html("<div id='cgit'>"); | ||
666 | if (!ctx->cfg.noheader) | ||
667 | print_header(ctx); | ||
662 | 668 | ||
663 | html("<table class='tabs'><tr><td>\n"); | 669 | html("<table class='tabs'><tr><td>\n"); |
664 | if (ctx->repo) { | 670 | if (ctx->repo) { |