diff options
| author | Alexander Leonhardt <equinox.salexander@gmail.com> | |
|---|---|---|
| 2026-08-15 19:27:30 +0200 | ||
| committer | Alexander Leonhardt <equinox.salexander@gmail.com> | |
| 2026-08-16 12:50:57 +0200 | ||
| commit | 21601449d12ce20f9a72836995150eba772eb58b (patch) | |
| tree | 7103aa42832a1399d4a49d3edf6ca788ca00444f /ui-shared.c | |
| parent | f7deb6e32bb486d7ec9613ba60d5d553157d767f (diff) | |
| download | cgit-21601449d12ce20f9a72836995150eba772eb58b.tar.gz cgit-21601449d12ce20f9a72836995150eba772eb58b.tar.bz2 cgit-21601449d12ce20f9a72836995150eba772eb58b.zip | |
feat: Updated the generated html code and css code to be more mobile friendly even on small devices.
Diffstat (limited to 'ui-shared.c')
| -rw-r--r-- | ui-shared.c | 39 |
1 files changed, 21 insertions, 18 deletions
diff --git a/ui-shared.c b/ui-shared.c index 9ee2e5b..9a33806 100644 --- a/ui-shared.c +++ b/ui-shared.c @@ -1020,22 +1020,8 @@ static void print_header(void) html("<td class='main'>"); if (ctx.repo) { cgit_index_link("index", NULL, NULL, NULL, NULL, 0, 1); - html(" > "); + 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); @@ -1043,10 +1029,10 @@ static void print_header(void) } html("</td></tr>\n"); - html("<tr><td class='sub'>"); + html("<tr><td colspan='2' class='sub'>"); if (ctx.repo) { html_txt(ctx.repo->desc); - html("</td><td class='sub right'>"); + html("</td></tr><tr><td colspan='2' class='subem'>"); if (ctx.repo->owner_filter) { cgit_open_filter(ctx.repo->owner_filter); html_txt(ctx.repo->owner); @@ -1054,11 +1040,28 @@ 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("</td></tr></table>\n"); + html("</tr></table>\n"); } void cgit_print_pageheader(void) |