From f135569b2be3fb1816f802f9a162b3743b735d1c Mon Sep 17 00:00:00 2001 From: Lars Hjemli Date: Sat, 12 Apr 2008 15:53:31 +0200 Subject: Replace sidebar/logo This replaces the sidebar with a more 'common' header layout and also updates the logo. Not quite finished yet, though. Signed-off-by: Lars Hjemli --- ui-shared.c | 125 +++++++++++++++++++++--------------------------------------- 1 file changed, 44 insertions(+), 81 deletions(-) (limited to 'ui-shared.c') diff --git a/ui-shared.c b/ui-shared.c index aa65988..7287956 100644 --- a/ui-shared.c +++ b/ui-shared.c @@ -7,6 +7,7 @@ */ #include "cgit.h" +#include "cmd.h" #include "html.h" const char cgit_doctype[] = @@ -465,97 +466,59 @@ void add_hidden_formfields(int incl_head, int incl_search, char *page) } } +char *hc(struct cgit_cmd *cmd, const char *page) +{ + return (strcmp(cmd->name, page) ? NULL : "active"); +} + void cgit_print_pageheader(struct cgit_context *ctx) { - static const char *default_info = "This is cgit, a fast webinterface for git repositories"; - int header = 0; - char *url; + struct cgit_cmd *cmd = cgit_get_cmd(ctx); - html("\n"); - html("\n"); - - html("
\n"); + html("
\n"); + html("
"); } void cgit_print_filemode(unsigned short mode) -- cgit v1.2.3 From 7c0d2d9fbd3a29d295c8067f7798507853759eae Mon Sep 17 00:00:00 2001 From: Lars Hjemli Date: Sat, 12 Apr 2008 19:59:41 +0200 Subject: Add fixed link to index page from repo header This makes it easier to get back to the index page, and also re-enables the usage of logo-link in cgitrc. Signed-off-by: Lars Hjemli --- ui-shared.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'ui-shared.c') diff --git a/ui-shared.c b/ui-shared.c index 7287956..03d147f 100644 --- a/ui-shared.c +++ b/ui-shared.c @@ -478,14 +478,20 @@ void cgit_print_pageheader(struct cgit_context *ctx) html("\n"); html("\n"); html("\n"); html("\n"); html("\n\n\n\n"); + html("
\n\n\n"); } int print_branch_option(const char *refname, const unsigned char *sha1, @@ -485,21 +485,46 @@ void cgit_print_pageheader(struct cgit_context *ctx) html("'>\n"); + html(""); if (ctx->repo) { +/* html("index / "); - html_txt(ctx->repo->name); + html("'>index : "); +*/ + reporevlink(NULL, ctx->repo->name, NULL, hc(cmd, "summary"), + ctx->qry.head, NULL, NULL); + html(" : "); + html_txt(ctx->qry.page); + html(""); + html("\n"); + add_hidden_formfields(0, 1, ctx->qry.page); + html(" "); + html(""); + html(""); } else html_txt(ctx->cfg.root_title); - html("\n"); - html(""); - if (ctx->repo) + html("\n"); + + html("repo) { + html(" colspan='2'>"); html_txt(ctx->repo->desc); - else - html_txt(ctx->cfg.index_info); + } +/* + else if (ctx->cfg.root_subtitle) + html_txt(ctx->cfg.root_subtitle); +*/ + else { + html(">"); + html_txt("a fast webinterface for the git dscm"); + } html("\n"); + + html("\n"); html("\n"); html("
\n"); @@ -518,13 +543,23 @@ void cgit_print_pageheader(struct cgit_context *ctx) ctx->qry.sha1, ctx->qry.sha2, NULL); cgit_patch_link("patch", NULL, hc(cmd, "patch"), ctx->qry.head, ctx->qry.sha1); - html(""); - html("
\n"); - add_hidden_formfields(0, 1, ctx->qry.page); - html(" "); - html(""); + html("
"); + html("\n"); + add_hidden_formfields(1, 0, "log"); + html("\n"); + html("\n"); + html("\n"); + html("\n"); } else { html(" --- ui-shared.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'ui-shared.c') diff --git a/ui-shared.c b/ui-shared.c index 782caa7..6253a90 100644 --- a/ui-shared.c +++ b/ui-shared.c @@ -555,7 +555,7 @@ void cgit_print_pageheader(struct cgit_context *ctx) html_option("author", "author", ctx->qry.grep); html_option("committer", "committer", ctx->qry.grep); html("\n"); - html("\n"); html("\n"); @@ -564,6 +564,15 @@ void cgit_print_pageheader(struct cgit_context *ctx) html("index\n"); + html(""); + html("
\n"); + html("\n"); + html("\n"); + html("
"); } html("
\n"); html("
"); -- cgit v1.2.3 From 39912a24edf45497e668ebda25636aa6f6db0c9b Mon Sep 17 00:00:00 2001 From: Lars Hjemli Date: Sun, 13 Apr 2008 12:20:00 +0200 Subject: Remove 'patch' link from tab, add to commit view It's a bit confusing to enter the patch view from the tab, since it has no layout. And the commit view has always lacked showing the commit id. Both of these warts are fixed by this commit, which adds a new header line in the commit view which shows the commit id as a 'permalink' to the current commit and also adds a link to the patch view of the current commit. Signed-off-by: Lars Hjemli --- ui-shared.c | 2 -- 1 file changed, 2 deletions(-) (limited to 'ui-shared.c') diff --git a/ui-shared.c b/ui-shared.c index 6253a90..bb08c4a 100644 --- a/ui-shared.c +++ b/ui-shared.c @@ -541,8 +541,6 @@ void cgit_print_pageheader(struct cgit_context *ctx) ctx->qry.head, ctx->qry.sha1); cgit_diff_link("diff", NULL, hc(cmd, "diff"), ctx->qry.head, ctx->qry.sha1, ctx->qry.sha2, NULL); - cgit_patch_link("patch", NULL, hc(cmd, "patch"), ctx->qry.head, - ctx->qry.sha1); html(""); html("