mirror of
https://git.zx2c4.com/cgit
synced 2024-11-26 02:18:42 +00:00
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>
This commit is contained in:
parent
0cbb50841a
commit
ef0c6aadf7
2
cgit.c
2
cgit.c
@ -49,6 +49,8 @@ void config_cb(const char *name, const char *value)
|
|||||||
ctx.cfg.virtual_root = "";
|
ctx.cfg.virtual_root = "";
|
||||||
} else if (!strcmp(name, "nocache"))
|
} else if (!strcmp(name, "nocache"))
|
||||||
ctx.cfg.nocache = atoi(value);
|
ctx.cfg.nocache = atoi(value);
|
||||||
|
else if (!strcmp(name, "noheader"))
|
||||||
|
ctx.cfg.noheader = atoi(value);
|
||||||
else if (!strcmp(name, "snapshots"))
|
else if (!strcmp(name, "snapshots"))
|
||||||
ctx.cfg.snapshots = cgit_parse_snapshots_mask(value);
|
ctx.cfg.snapshots = cgit_parse_snapshots_mask(value);
|
||||||
else if (!strcmp(name, "enable-index-links"))
|
else if (!strcmp(name, "enable-index-links"))
|
||||||
|
1
cgit.h
1
cgit.h
@ -172,6 +172,7 @@ struct cgit_config {
|
|||||||
int summary_log;
|
int summary_log;
|
||||||
int summary_tags;
|
int summary_tags;
|
||||||
int embedded;
|
int embedded;
|
||||||
|
int noheader;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct cgit_page {
|
struct cgit_page {
|
||||||
|
20
ui-shared.c
20
ui-shared.c
@ -611,14 +611,8 @@ char *hc(struct cgit_cmd *cmd, const char *page)
|
|||||||
return (strcmp(cmd ? cmd->name : fallback_cmd, page) ? NULL : "active");
|
return (strcmp(cmd ? cmd->name : fallback_cmd, page) ? NULL : "active");
|
||||||
}
|
}
|
||||||
|
|
||||||
void cgit_print_pageheader(struct cgit_context *ctx)
|
static void print_header(struct cgit_context *ctx)
|
||||||
{
|
{
|
||||||
struct cgit_cmd *cmd = cgit_get_cmd(ctx);
|
|
||||||
|
|
||||||
if (!cmd && ctx->repo)
|
|
||||||
fallback_cmd = "summary";
|
|
||||||
|
|
||||||
html("<div id='cgit'>");
|
|
||||||
html("<table id='header'>\n");
|
html("<table id='header'>\n");
|
||||||
html("<tr>\n");
|
html("<tr>\n");
|
||||||
html("<td class='logo' rowspan='2'><a href='");
|
html("<td class='logo' rowspan='2'><a href='");
|
||||||
@ -659,6 +653,18 @@ void cgit_print_pageheader(struct cgit_context *ctx)
|
|||||||
html_include(ctx->cfg.index_info);
|
html_include(ctx->cfg.index_info);
|
||||||
}
|
}
|
||||||
html("</td></tr></table>\n");
|
html("</td></tr></table>\n");
|
||||||
|
}
|
||||||
|
|
||||||
|
void cgit_print_pageheader(struct cgit_context *ctx)
|
||||||
|
{
|
||||||
|
struct cgit_cmd *cmd = cgit_get_cmd(ctx);
|
||||||
|
|
||||||
|
if (!cmd && ctx->repo)
|
||||||
|
fallback_cmd = "summary";
|
||||||
|
|
||||||
|
html("<div id='cgit'>");
|
||||||
|
if (!ctx->cfg.noheader)
|
||||||
|
print_header(ctx);
|
||||||
|
|
||||||
html("<table class='tabs'><tr><td>\n");
|
html("<table class='tabs'><tr><td>\n");
|
||||||
if (ctx->repo) {
|
if (ctx->repo) {
|
||||||
|
Loading…
Reference in New Issue
Block a user