aboutsummaryrefslogtreecommitdiffstats
path: root/ui-shared.c
diff options
context:
space:
mode:
authorAlexander Leonhardt <equinox.salexander@gmail.com>
2026-08-16 13:34:13 +0200
committerAlexander Leonhardt <equinox.salexander@gmail.com>
2026-08-16 14:13:12 +0200
commit5c46a55ba69406efe441af48b40bdedf56345c79 (patch)
tree795c9e1827fd654f9af3a3e493a164256be0cc2a /ui-shared.c
parent73466f1c66f918e5ce285172c69bd682ae25f78b (diff)
downloadcgit-5c46a55ba69406efe441af48b40bdedf56345c79.tar.gz
cgit-5c46a55ba69406efe441af48b40bdedf56345c79.tar.bz2
cgit-5c46a55ba69406efe441af48b40bdedf56345c79.zip
fix: Updated the structure in the header to resemble the original design, updated css to adapt to mobile phones
Diffstat (limited to 'ui-shared.c')
-rw-r--r--ui-shared.c37
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)