{"schema":"libjg2-1",
"vpath":"/git/",
"avatar":"/git/avatar/",
"alang":"",
"gen_ut":1745906421,
"reponame":"cgit",
"desc":"CGI gitweb",
"owner": { "name": "Andy Green", "email": "andy@warmcat.com", "md5": "c50933ca2aa61e0fe2c43d46bb6b59cb" },"url":"https://warmcat.com/repo/cgit",
"f":3,
"items": [
{"schema":"libjg2-1",
"cid":"859e1705a7c041431d04d712c8b9583f",
"commit": {"type":"commit",
"time": 1530578607,
"time_ofs": 480,
"oid_tree": { "oid": "8ebf37708cc8a03ab970b79b53f124a03daaabac", "alias": []},
"oid":{ "oid": "75836a8e8678049d15e4a65c8883d0270be3b93e", "alias": []},
"msg": "noheader: place branch combo on tabs if no header",
"sig_commit": { "git_time": { "time": 1530578607, "offset": 480 }, "name": "Andy Green", "email": "andy@warmcat.com", "md5": "c50933ca2aa61e0fe2c43d46bb6b59cb" },
"sig_author": { "git_time": { "time": 1529499794, "offset": 480 }, "name": "Andy Green", "email": "andy@warmcat.com", "md5": "c50933ca2aa61e0fe2c43d46bb6b59cb" }},
"body": "noheader: place branch combo on tabs if no header\n\nnoheader\u003d1 stops the static page header from being emitted by\ncgit, but along with that, the small form that lets the user\nchange branch context on the page is also lost.\n\nThis isn't actually static since it contains a dynamic list of\nbranches; it can't be reproduced on the user's external header\nstatic html. So it seems it doesn't belong to the set of header\nthings that should be disabled.\n\nThis patch relocates the branch selection combo and\nform on the left of the tabs line if noheader\u003d1. It doesn't\nchange anything if noheader is not set.\n\nSigned-off-by: Andy Green \u003candy@warmcat.com\u003e\nReviewed-by: John Keeping \u003cjohn@keeping.me.uk\u003e"
,
"diff": "diff --git a/ui-shared.c b/ui-shared.c\nindex 24fa9f7..10baf8a 100644\n--- a/ui-shared.c\n+++ b/ui-shared.c\n@@ -927,6 +927,19 @@ static void cgit_print_path_crumbs(char *path)\n \tctx.qry.path \u003d old_path;\n }\n \n+static void print_branch_combo_form(void)\n+{\n+\thtml(\u0022\u003cform method\u003d'get'\u003e\u005cn\u0022);\n+\tcgit_add_hidden_formfields(0, 1, ctx.qry.page);\n+\thtml(\u0022\u003cselect name\u003d'h' onchange\u003d'this.form.submit();'\u003e\u005cn\u0022);\n+\tfor_each_branch_ref(print_branch_option, ctx.qry.head);\n+\tif (ctx.repo-\u003eenable_remote_branches)\n+\t\tfor_each_remote_ref(print_branch_option, ctx.qry.head);\n+\thtml(\u0022\u003c/select\u003e \u0022);\n+\thtml(\u0022\u003cinput type\u003d'submit' value\u003d'switch'/\u003e\u0022);\n+\thtml(\u0022\u003c/form\u003e\u0022);\n+}\n+\n static void print_header(void)\n {\n \tchar *logo \u003d NULL, *logo_link \u003d NULL;\n@@ -960,15 +973,7 @@ static void print_header(void)\n \t\tcgit_summary_link(ctx.repo-\u003ename, ctx.repo-\u003ename, NULL, NULL);\n \t\tif (ctx.env.authenticated) {\n \t\t\thtml(\u0022\u003c/td\u003e\u003ctd class\u003d'form'\u003e\u0022);\n-\t\t\thtml(\u0022\u003cform method\u003d'get'\u003e\u005cn\u0022);\n-\t\t\tcgit_add_hidden_formfields(0, 1, ctx.qry.page);\n-\t\t\thtml(\u0022\u003cselect name\u003d'h' onchange\u003d'this.form.submit();'\u003e\u005cn\u0022);\n-\t\t\tfor_each_branch_ref(print_branch_option, ctx.qry.head);\n-\t\t\tif (ctx.repo-\u003eenable_remote_branches)\n-\t\t\t\tfor_each_remote_ref(print_branch_option, ctx.qry.head);\n-\t\t\thtml(\u0022\u003c/select\u003e \u0022);\n-\t\t\thtml(\u0022\u003cinput type\u003d'submit' value\u003d'switch'/\u003e\u0022);\n-\t\t\thtml(\u0022\u003c/form\u003e\u0022);\n+\t\t\tprint_branch_combo_form();\n \t\t}\n \t} else\n \t\thtml_txt(ctx.cfg.root_title);\n@@ -992,8 +997,15 @@ void cgit_print_pageheader(void)\n \tif (!ctx.env.authenticated || !ctx.cfg.noheader)\n \t\tprint_header();\n \n-\thtml(\u0022\u003ctable class\u003d'tabs'\u003e\u003ctr\u003e\u003ctd\u003e\u005cn\u0022);\n+\thtml(\u0022\u003ctable class\u003d'tabs'\u003e\u003ctr\u003e\u005cn\u0022);\n \tif (ctx.env.authenticated \u0026\u0026 ctx.repo) {\n+\t\tif (ctx.cfg.noheader) {\n+\t\t\thtml(\u0022\u003ctd class\u003d'form' style\u003d'text-align:left'\u003e\u0022);\n+\t\t\tprint_branch_combo_form();\n+\t\t\thtml(\u0022\u003c/td\u003e\u003ctd style\u003d'text-align:center'\u003e\u0022);\n+\t\t}\n+\t\thtml(\u0022\u003ctd\u003e\u0022);\n+\n \t\tif (ctx.repo-\u003ereadme.nr)\n \t\t\treporevlink(\u0022about\u0022, \u0022about\u0022, NULL,\n \t\t\t\t hc(\u0022about\u0022), ctx.qry.head, NULL,\n@@ -1046,6 +1058,8 @@ void cgit_print_pageheader(void)\n \t\thtml(\u0022\u003c/form\u003e\u005cn\u0022);\n \t} else if (ctx.env.authenticated) {\n \t\tchar *currenturl \u003d cgit_currenturl();\n+\n+\t\thtml(\u0022\u003ctd\u003e\u0022);\n \t\tsite_link(NULL, \u0022index\u0022, NULL, hc(\u0022repolist\u0022), NULL, NULL, 0, 1);\n \t\tif (ctx.cfg.root_readme)\n \t\t\tsite_link(\u0022about\u0022, \u0022about\u0022, NULL, hc(\u0022about\u0022),\n","s":{"c":1745906421,"u": 1551}}
],"g": 2767,"chitpc": 0,"ehitpc": 0,"indexed":0
,
"ab": 0, "si": 0, "db":0, "di":0, "sat":0, "lfc": "0000"}