diff options
Diffstat (limited to 'ui-shared.c')
| -rw-r--r-- | ui-shared.c | 37 |
1 files changed, 17 insertions, 20 deletions
diff --git a/ui-shared.c b/ui-shared.c index 9a33806..d8d5d76 100644 --- a/ui-shared.c +++ b/ui-shared.c @@ -1022,17 +1022,30 @@ static void print_header(void) cgit_index_link("index", NULL, NULL, NULL, NULL, 0, 1); html("<span class=\"separator\"> ❧ </span>"); cgit_summary_link(ctx.repo->name, NULL, NULL, NULL); + if (ctx.env.authenticated) { + html("</td><td class='form'>"); + html("<form method='get'>\n"); + cgit_add_hidden_formfields(0, 1, ctx.qry.page); + html("<select name='h' onchange='this.form.submit();'>\n"); + refs_for_each_branch_ref(get_main_ref_store(the_repository), + print_branch_option, ctx.qry.head); + if (ctx.repo->enable_remote_branches) + refs_for_each_remote_ref(get_main_ref_store(the_repository), + print_branch_option, ctx.qry.head); + html("</select> "); + html("<input type='submit' value='switch'/>"); + html("</form>"); + } } else { html("<span id='root-title'>"); html_txt(ctx.cfg.root_title); html("</span>"); } - html("</td></tr>\n"); - html("<tr><td colspan='2' class='sub'>"); + html("</td></tr><tr><td class='sub'>"); if (ctx.repo) { html_txt(ctx.repo->desc); - html("</td></tr><tr><td colspan='2' class='subem'>"); + html("</td><td class='subem'>"); if (ctx.repo->owner_filter) { cgit_open_filter(ctx.repo->owner_filter); html_txt(ctx.repo->owner); @@ -1040,28 +1053,12 @@ static void print_header(void) } else { html_txt(ctx.repo->owner); } - html("</td></tr><tr>"); - if (ctx.env.authenticated) { - html("<td></td><td class='form'>"); - html("<form method='get'>\n"); - cgit_add_hidden_formfields(0, 1, ctx.qry.page); - html("<select name='h' onchange='this.form.submit();'>\n"); - refs_for_each_branch_ref(get_main_ref_store(the_repository), - print_branch_option, ctx.qry.head); - if (ctx.repo->enable_remote_branches) - refs_for_each_remote_ref(get_main_ref_store(the_repository), - print_branch_option, ctx.qry.head); - html("</select> "); - html("<input type='submit' value='switch'/>"); - html("</form>"); - } - html("</td>"); } else { if (ctx.cfg.root_desc) html_txt(ctx.cfg.root_desc); } - html("</tr></table>\n"); + html("</td></tr></table>\n"); } void cgit_print_pageheader(void) |