]> gitweb.ps.run Git - ps-cgit/blobdiff - ui-shared.c
Minor fixup in tree-view css
[ps-cgit] / ui-shared.c
index 72879567b43a32e853e7daac96a2b44a85635b6d..73e3d4cc81f2216bc2c9edaa495057ab8b0e6034 100644 (file)
@@ -478,14 +478,20 @@ void cgit_print_pageheader(struct cgit_context *ctx)
        html("<table id='header'>\n");
        html("<tr>\n");
        html("<td class='logo' rowspan='2'><a href='");
-       html_attr(cgit_rooturl());
+       if (ctx->cfg.logo_link)
+               html_attr(ctx->cfg.logo_link);
+       else
+               html_attr(cgit_rooturl());
        html("'><img src='");
        html_attr(ctx->cfg.logo);
        html("'/></a></td>\n");
        html("<td class='main'>");
-       if (ctx->repo)
+       if (ctx->repo) {
+               html("<a href='");
+               html_attr(cgit_rooturl());
+               html("'>index</a> / ");
                html_txt(ctx->repo->name);
-       else
+       else
                html_txt(ctx->cfg.root_title);
        html("</td></tr>\n");
        html("<tr><td class='sub'>");
@@ -512,6 +518,13 @@ 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("</td><td class='branch'>");
+               html("<form method='get' action=''>\n");
+               add_hidden_formfields(0, 1, ctx->qry.page);
+               html("<select name='h' onchange='this.form.submit();'>\n");
+               for_each_branch_ref(print_branch_option, ctx->qry.head);
+               html("</select> ");
+               html("<input type='submit' name='' value='switch'/>");
        } else {
                html("<a class='active' href='");
                html_attr(cgit_rooturl());