author | Lars Hjemli <hjemli@gmail.com> | 2008-04-28 23:13:08 (UTC) |
---|---|---|
committer | Lars Hjemli <hjemli@gmail.com> | 2008-04-28 23:13:08 (UTC) |
commit | 905dbaef5aa33ea11d385b82de0188fee73dd655 (patch) (side-by-side diff) | |
tree | 34712da2eef917be04b2acc5585612b65c1e49cc /cgit.c | |
parent | d188ed4f2905e6d10abd26c45572a0d48eb53969 (diff) | |
parent | 71adba1f1678914063fc109cf3805afde2c68f75 (diff) | |
download | cgit-905dbaef5aa33ea11d385b82de0188fee73dd655.zip cgit-905dbaef5aa33ea11d385b82de0188fee73dd655.tar.gz cgit-905dbaef5aa33ea11d385b82de0188fee73dd655.tar.bz2 |
Merge branch 'lh/about'
* lh/about:
Add 'about site' and 'about repo' pages
Prepare for 'about site' page / add 'root-readme' option to cgitrc
Make it possible for a single cmd to work both with and without a repo
Re-enable 'index-info' and add support for 'root-desc' in cgitrc
Move included header-file out of repolist table
Prepare for 'about repo' page
-rw-r--r-- | cgit.c | 16 |
1 files changed, 15 insertions, 1 deletions
@@ -20,4 +20,8 @@ void config_cb(const char *name, const char *value) if (!strcmp(name, "root-title")) ctx.cfg.root_title = xstrdup(value); + else if (!strcmp(name, "root-desc")) + ctx.cfg.root_desc = xstrdup(value); + else if (!strcmp(name, "root-readme")) + ctx.cfg.root_readme = xstrdup(value); else if (!strcmp(name, "css")) ctx.cfg.css = xstrdup(value); @@ -160,4 +164,5 @@ static void prepare_context(struct cgit_context *ctx) ctx->cfg.robots = "index, nofollow"; ctx->cfg.root_title = "Git repository browser"; + ctx->cfg.root_desc = "a fast webinterface for the git dscm"; ctx->cfg.script_name = CGIT_SCRIPT_NAME; ctx->page.mimetype = "text/html"; @@ -305,5 +310,14 @@ static void process_request(struct cgit_context *ctx) } - if (cmd->want_repo && prepare_repo_cmd(ctx)) + if (cmd->want_repo && !ctx->repo) { + cgit_print_http_headers(ctx); + cgit_print_docstart(ctx); + cgit_print_pageheader(ctx); + cgit_print_error(fmt("No repository selected")); + cgit_print_docend(); + return; + } + + if (ctx->repo && prepare_repo_cmd(ctx)) return; |